\input{titlepag.tex}
\section{Gnuplot}
{\bf gnuplot} is a command-driven interactive function and data plotting program.

For help on any topic, type {\bf help} followed by the name of the topic.  If the
precise name of the topic is not known, type {\bf help} and a menu will be given.
Typing a question mark {\bf ?} after any {\bf help} prompt will cause the menu to be
listed again.

The new {\bf gnuplot} user should begin by reading the {\bf introduction} topic (see
{\bf help introduction}) and the {\bf plot} topic (see {\bf help plot}).  Additional help
can be obtained from the USENET newsgroup comp.graphics.apps.gnuplot.

\section{Copyright}
\begin{verbatim}
     Copyright (C) 1986 - 1993   Thomas Williams, Colin Kelley
\end{verbatim}

Permission to use, copy, and distribute this software and its documentation
for any purpose with or without fee is hereby granted, provided that the
above copyright notice appears in all copies and that both that copyright
notice and this permission notice appear in supporting documentation.

Permission to modify the software is granted, but not the right to distribute
the modified code.  Modifications are to be distributed as patches to the
released version.

This software is provided ``as is'' without express or implied warranty.


\begin{verbatim}
  AUTHORS
\end{verbatim}

\begin{verbatim}
    Original Software:
      Thomas Williams,  Colin Kelley.
\end{verbatim}

\begin{verbatim}
    Gnuplot 2.0 additions:
        Russell Lang, Dave Kotz, John Campbell.
\end{verbatim}

\begin{verbatim}
    Gnuplot 3.0 additions:
        Gershon Elber and many others.
\end{verbatim}

\section{Seeking-assistance}
There is a mailing list for {\bf gnuplot} users.  Note, however, that the
newsgroup
\begin{verbatim}
        comp.graphics.apps.gnuplot
\end{verbatim}
is identical to the mailing list (they both carry the same set of messages).
We prefer that you read the messages through the newsgroup rather than
subscribing to the mailing list.  Administrative requests should be sent to
\begin{verbatim}
   majordomo@dartmouth.edu
\end{verbatim}
Send a message with the body (not the subject) consisting of the single word
``help'' (without the quotes) for more details.

The address for mailing to list members is:
\begin{verbatim}
  info-gnuplot@dartmouth.edu
\end{verbatim}

Bug reports and code contributions should be mailed to:
\begin{verbatim}
  bug-gnuplot@dartmouth.edu
\end{verbatim}

The list of those interested in beta-test versions is:
\begin{verbatim}
  info-gnuplot-beta@dartmouth.edu
\end{verbatim}

There is also a World Wide Web page with up-to-date information, including
known bugs:
\begin{verbatim}
   http://www.cs.dartmouth.edu/gnuplot
\end{verbatim}

Before seeking help, please check the FAQ (Frequently Asked Questions) list.
If you do not have a copy of the FAQ, you may request a copy by email from
the Majordomo address above, or see the WWW {\bf gnuplot} page.

When posting a question, please include full details of the version of
{\bf gnuplot}, the machine, and operating system you are using.  A \_small\_ script
demonstrating the problem may be useful.  Function plots are preferable to
datafile plots.  If email-ing to info-gnuplot, please state whether or not
you are subscribed to the list, so that users who use news will know to email
a reply to you.  There is a form for such postings on the WWW site.
\section{Introduction}
{\bf gnuplot} is a command-driven interactive function plotting program.  It is
case sensitive (commands and function names written in lowercase are not the
same as those written in CAPS).  All command names may be abbreviated, as
long as the abbreviation is not ambiguous.  Any number of commands may appear
on a line, separated by semicolons (;).  Strings are indicated with quotes.
They may be either single or double quotation marks, e.g.,

\begin{verbatim}
         load "filename"
         cd 'dir'
\end{verbatim}

although there are some subtle differences (see {\bf syntax} for more details).

Any command-line arguments are assumed to be names of files containing
{\bf gnuplot} commands, with the exception of standard X11 arguments, which are
processed first.  Each file is loaded with the {\bf load} command, in the order
specified.  {\bf gnuplot} exits after the last file is processed.  When no load
files are named, {\bf gnuplot} enters into an interactive mode.

Commands may extend over several input lines by ending each line but the last
with a backslash ($\backslash$).  The backslash must be the LAST character on each line.
The effect is as if the backslash and newline were not there.  That is, no
white space is implied, nor is a comment terminated.  Therefore, commenting
out a continued line comments out the entire command (see {\bf comment}).

In this documentation, curly braces (\{\}) denote optional arguments and a
vertical bar ($|$) separates mutually exclusive choices.  {\bf gnuplot} keywords
or help topics are indicated by backquotes or {\bf boldface} (where available).
Angle brackets ($<$$>$) are used to mark replaceable tokens.

For help on any topic, type {\bf help} followed by the name of the topic or just
{\bf help} to get a menu of available topics.

The new {\bf gnuplot} user should begin by reading about the {\bf plot} command (type
{\bf help plot}).
\section{Cd}
The {\bf cd} command changes the working directory.

Syntax:
\begin{verbatim}
        cd '<directory-name>'
\end{verbatim}

The directory name must be enclosed in quotes.

Examples:
\begin{verbatim}
        cd 'subdir'
        cd ".."
\end{verbatim}

DOS users \_must\_ use single-quotes---backslash [$\backslash$] has special significance
inside double-quotes.  For example,

\begin{verbatim}
        cd "c:\newdata"      fails, but
        cd 'c:\newdata'      works as expected.
\end{verbatim}
\section{Call}
The {\bf call} command is identical to the load command with one exception: you
can have up to ten additional parameters to the command (delimited according
to the standard parser rules) which can be substituted into the lines read
from the file.  As each line is read from the {\bf call}ed input file, it is
scanned for the sequence {\bf \$} (dollar-sign) followed by a digit (0--9).  If
found, the sequence is replaced by the corresponding parameter from the
{\bf call} command line.  If the parameter was specified as a string in the
{\bf call} line, it is substituted without its enclosing quotes.  {\bf \$} followed by
any character other than a digit will be that character.  E.g. use {\bf \$\$} to
get a single {\bf \$}.  Providing more than ten parameters on the {\bf call} command
line will cause an error.  A parameter that was not provided substitutes as
nothing.  Files being {\bf call}ed may themselves contain {\bf call} or {\bf load}
commands.

The {\bf call} command MUST be the last command on a multi-command line.

Syntax:
\begin{verbatim}
        call "<input-file>" <parameter-0> <parm-1> ... <parm-9>
\end{verbatim}

The name of the input file must be enclosed in quotes, and it is recommended
that parameters are similarly enclosed in quotes.

Example:

If the file 'calltest.gp' contains the line:

\begin{verbatim}
    pause 0 "p0=$0 p1=$1 p2=$2 p3=$3 p4=$4 p5=$5 p6=$6 p7=x$7x"
\end{verbatim}

entering the command:

\begin{verbatim}
    call 'calltest.gp' "abcd" 1.2 + "'quoted'" -- "$2"
\end{verbatim}

will display:

\begin{verbatim}
    p0=abcd p1=1.2 p2=+ p3='quoted' p4=- p5=- p6=$2 p7=xx
\end{verbatim}

NOTE: there is a clash in syntax with the datafile {\bf using} callback
operator.  Use \$\$n to access column n from a datafile inside a {\bf call}ed
datafile plot.
\section{Clear}
The {\bf clear} command erases the current screen or output device as specified
by {\bf set output}.  This usually generates a formfeed on hardcopy devices.  Use
{\bf set terminal} to set the device type.
\section{Command-line-editing}
Command-line editing is supported by the Unix, Atari, VMS, MS-DOS and OS/2
versions of {\bf gnuplot}.  Also, a history mechanism allows previous commands to
be edited and re-executed.  After the command line has been edited, a newline
or carriage return will enter the entire line without regard to where the
cursor is positioned.

The editing commands are as follows:


\begin{center}
\begin{tabular}{|ccl|} \hline
Character && Function \\ \hline
\multicolumn{3}{|c|}{Line Editing}\\
\verb~^B~ && move back a single character.\\
\verb~^F~ && move forward a single character.\\
\verb~^A~ && move to the beginning of the line.\\
\verb~^E~ && move to the end of the line.\\
\verb~^H, DEL~ && delete the previous character.\\
\verb~^D~ && delete the current character.\\
\verb~^K~ && delete from current position to the end of line.\\
\verb~^L, ^R~ && redraw line in case it gets trashed.\\
\verb~^U~ && delete the entire line. \\
\verb~^W~ && delete from the current word to the end of line. \\ \hline
\multicolumn{3}{|c|}{History} \\
\verb~^P~ && move back through history.\\
\verb~^N~ && move forward through history.\\
\hline
\end{tabular}
\end{center}

On the IBM PC, the use of a TSR program such as DOSEDIT or CED may be desired
for line editing.  The default makefile assumes that this is the case;  by
default {\bf gnuplot} will be compiled with no line-editing capability.  If you
want to use {\bf gnuplot}'s line editing, set READLINE in the makefile and add
readline.obj to the link file.  The following arrow keys may be used on the
IBM PC and Atari versions if readline is used:


\begin{center}
\begin{tabular}{|ccl|} \hline
Arrow key  & Function & \\ \hline
Left       & same as \verb~^B~. & \\
Right      & same as \verb~^F~. & \\
Ctrl Left  & same as \verb~^A~. & \\
Ctrl Right & same as \verb~^E~. & \\
Up         & same as \verb~^P~. & \\
Down       & same as \verb~^N~. & \\
\hline
\end{tabular}
\end{center}

The Atari version of readline defines some additional key aliases:


\begin{center}
\begin{tabular}{|ccl|} \hline
Arrow key & Function & \\ \hline
Undo      & same as \verb~^L~. & \\
Home      & same as \verb~^A~. & \\
Ctrl Home & same as \verb~^E~. & \\
Esc       & same as \verb~^U~. & \\
Help      & `{\bf help}' plus return. & \\
Ctrl Help & `{\bf help }'. & \\
\hline
\end{tabular}
\end{center}

(The readline function in {\bf gnuplot} is not the same as the readline used in
GNU Bash and GNU Emacs.  It is somewhat compatible, however.)
\section{Comment}
Comments are supported as follows: a \# may appear in most places in a line
and {\bf gnuplot} will ignore the rest of the line.  It will not have this effect
inside quotes, inside numbers (including complex numbers), inside command
substitutions, etc.  In short, it works anywhere it makes sense to work.
\section{Environment}
A number of shell environment variables are understood by {\bf gnuplot}.  None of
these are required, but may be useful.

If GNUTERM is defined, it is used as the name of the terminal type to be
used.  This overrides any terminal type sensed by {\bf gnuplot} on start-up, but
is itself overridden by the .gnuplot (or equivalent) start-up file (see
{\bf start-up}) and, of course, by later explicit changes.

On Unix, AmigaDOS, AtariTOS, MS-DOS and OS/2, GNUHELP may be defined to be
the pathname of the HELP file (gnuplot.gih).

On VMS, the logical name gnuplot\$HELP should be defined as the name of the
help library for {\bf gnuplot}.  The {\bf gnuplot} help can be put inside any system
help library, allowing access to help from both within and outside {\bf gnuplot}
if desired.

On Unix, HOME is used as the name of a directory to search for a .gnuplot
file if none is found in the current directory.  On AmigaDOS, AtariTOS,
MS-DOS and OS/2, {\bf gnuplot} is used.  On VMS, SYS\$LOGIN: is used. See {\bf help
start-up}.

On Unix, PAGER is used as an output filter for help messages.

On Unix, AtariTOS and AmigaDOS, SHELL is used for the {\bf shell} command.  On
MS-DOS and OS/2, COMSPEC is used for the {\bf shell} command.

On MS-DOS, if the BGI interface is used, the variable {\bf BGI} is used to point
to the full path of the BGI drivers directory.  Furthermore, SVGA is used to
name the Super VGA BGI driver in 800x600 resolution and its mode of operation
as 'Name.Mode'.  E.g., if the Super VGA driver is C:$\backslash$TC$\backslash$BGI$\backslash$SVGADRV.BGI and
mode 3 is used for 800x600 resolution, then use 'set BGI=C:$\backslash$TC$\backslash$BGI' and 'set
SVGA=SVGADRV.3'.

FIT\_SCRIPT may be used to specify a {\bf gnuplot} command to be executed when a
fit is interrupted---see {\bf fit}.  FIT\_LOG specifies the filename of the
logfile maintained by fit.
\section{Exit}
The commands {\bf exit} and {\bf quit} and the END-OF-FILE character will exit
{\bf gnuplot}.  Each of these commands will clear the output device (as does
the {\bf clear} command) before exiting.
\section{Expressions}
In general, any mathematical expression accepted by C, FORTRAN, Pascal, or
BASIC is valid.  The precedence of these operators is determined by the
specifications of the C programming language.  White space (spaces and tabs)
is ignored inside expressions.

Complex constants are expressed as \{$<$real$>$,$<$imag$>$\}, where $<$real$>$ and $<$imag$>$
must be numerical constants.  For example, \{3,2\} represents 3 + 2i; \{0,1\}
represents {\bf i} itself.  The curly braces are explicitly required here.

Note that gnuplot uses both ``real'' and ``integer'' arithmetic, like FORTRAN and
C.  Integers are entered as ``1'', ''-10'', etc; reals as ``1.0'', ''-10.0'', ``1e1'',
3.5e-1, etc.  The most important difference between the two forms is in
division: division of integers truncates: 5/2 = 1; division of reals does
not: 5.0/2.0 = 2.5.  In mixed expressions, integers are ``promoted'' to reals
before evaluation: 5/2e1 = 2.5.  The result of division of a negative integer
by a positive one may vary among compilers.  Try a test like ``print -5/2'' to
determine if your system chooses -2 or -3 as the answer.

The real and imaginary parts of complex expressions are always real, whatever
the form in which they are entered: in \{3,2\} the ``3'' and ``2'' are reals, not
integers.
\subsection{Functions}
The functions in {\bf gnuplot} are the same as the corresponding functions in
the Unix math library, except that all functions accept integer, real, and
complex arguments, unless otherwise noted.  The {\bf sgn} function is also
supported, as in BASIC.

\begin{center}
\begin{tabular}{|ccl|} \hline
Function & Arguments & Returns \\ \hline
abs(x) & any  &  absolute value of {\tt x}, $|x|$; same type \\
abs(x) & complex &  length of {\tt x}, $\sqrt{{\mbox{real}(x)^{2} +
\mbox{imag}(x)^{2}}}$ \\
acos(x) & any  & $\cos^{-1} x$ (inverse cosine) in radians \\
arg(x) & complex & the phase of $x$ in radians\\
asin(x) & any  & $\sin^{-1} x$ (inverse sin) in radians \\
atan(x) & any  & $\tan^{-1} x$ (inverse tangent) in radians \\
besj0(x) & radians &  $j_{0}$ Bessel function of $x$ \\
besj1(x) & radians & $j_{1}$ Bessel function of $x$ \\
besy0(x) & radians & $y_{0}$ Bessel function of $x$ \\
besy1(x) & radians & $y_{1}$ Bessel function of $x$ \\
ceil(x) & any & $\lceil x \rceil$, smallest integer not less than $x$
(real part) \\
column(x) & int & column $x$ during datafile manipulation. \\
cos(x) & radians & $\cos x$, cosine of $x$ \\
cosh(x) & radians & $\cosh x$, hyperbolic cosine of $x$ \\
erf(x) & any & $\mbox{Erf}(\mbox{real}(x))$,  error function of real($x$) \\
erfc(x) & any & $\mbox{Erfc}(\mbox{real}(x))$,  1.0 - error function of real($x$) \\
exp(x) & any & $e^{x}$,  exponential function of $x$ \\
floor(x) & any & $\lfloor x \rfloor$,  largest integer not greater
than $x$ (real part) \\
gamma(x) & any & $\mbox{Gamma}(\mbox{real}(x))$,  gamma function of real($x$) \\
ibeta(p,q,x) & any & $\mbox{Ibeta}(\mbox{real}(p,q,x))$,  ibeta function of real($p$,$q$,$x$) \\
inverf(x) & any &  inverse error function of real($x$)  \\
igamma(a,x) & any & $\mbox{Igamma}(\mbox{real}(a,x))$,  igamma function of real($a$,$x$) \\
imag(x) & complex &  imaginary part of $x$ as a real number \\
invnorm(x) & any &  inverse normal distribution function of real($x$)  \\
int(x) & real &  integer part of $x$, truncated toward zero \\
lgamma(x) & any & $\mbox{Lgamma}(\mbox{real}(x))$,  lgamma function of real($x$) \\
log(x) & any & $\log_{e} x$,  natural logarithm (base $e$) of $x$ \\
log10(x) & any & $\log_{10} x$,  logarithm (base $10$) of $x$ \\
norm(x) & any & normal distribution (Gaussian) function of real($x$) \\
rand(x) & any & $\mbox{Rand}(\mbox{real}(x))$,  pseudo random number generator \\
real(x) & any &  real part of $x$ \\
sgn(x) & any & 1 if $x>0$, -1 if $x<0$, 0 if $x=0$. imag($x$) ignored \\
sin(x) & radians & $\sin x$, sine of $x$ \\
sinh(x) & radians & $\sinh x$, hyperbolic sine $x$ \\
sqrt(x) & any & $\sqrt{x}$,  square root of $x$ \\
tan(x) & radians & $\tan x$,  tangent of $x$ \\
tanh(x) & radians & $\tanh x$, hyperbolic tangent of $x$\\
valid(x) & int & test validity of $\mbox{column}(x)$ during datafile manip.\\
\hline
\end{tabular}
\end{center}
\subsection{Operators}
The operators in {\bf gnuplot} are the same as the corresponding operators in the
C programming language, except that all operators accept integer, real, and
complex arguments, unless otherwise noted.  The ** operator (exponentiation)
is supported, as in FORTRAN.

Parentheses may be used to change order of evaluation.
\subsubsection{Unary}
The following is a list of all the unary operators and their usages:


\begin{center}
\begin{tabular}{|ccl|} \hline
\multicolumn{3}{|c|}{Unary Operators}\\
Symbol & Example & Explanation \\ \hline
\verb@-@ & \verb@-a@ & unary minus \\
\verb@+@ & \verb@+a@ & unary plus (no-operation) \\
\verb@~@ & \verb@~a@ & * one's complement \\
\verb@!@ & \verb@!a@ & * logical negation \\
\verb@!@ & \verb@a!@ & * factorial \\
\verb@$@ & \verb@$3@ & * call arg/column during `using` manipulation \\
\hline
\end{tabular}
\end{center}
(*) Starred explanations indicate that the operator requires an integer
argument.

The factorial operator returns a real number to allow a greater range.
\subsubsection{Binary}
The following is a list of all the binary operators and their usages:


\begin{center}
\begin{tabular}{|ccl|} \hline
\multicolumn{3}{|c|}{Binary Operators} \\
Symbol & Example & Explanation \\ \hline
\verb~**~ & \verb~a**b~ & exponentiation\\
\verb~*~ & \verb~a*b~ & multiplication\\
\verb~/~ & \verb~a/b~ & division\\
\verb~%~ & \verb~a%b~ & * modulo\\
\verb~+~ & \verb~a+b~ & addition\\
\verb~-~ & \verb~a-b~ & subtraction\\
\verb~==~ & \verb~a==b~ & equality\\
\verb~!=~ & \verb~a!=b~ & inequality\\
\verb~<~ & \verb~a<b~ & less than\\
\verb~<=~ & \verb~a<=b~ & less than or equal to\\
\verb~>~ & \verb~a>b~ & greater than\\
\verb~>=~ & \verb~a>=b~ & greater than or equal to\\
\verb~&~ & \verb~a&b~ & * bitwise AND\\
\verb~^~ & \verb~a^b~ & * bitwise exclusive OR\\
\verb~|~ & \verb~a|b~ & * bitwise inclusive OR\\
\verb~&&~ & \verb~a&&b~ & * logical AND\\
\verb~||~ & \verb~a||b~ & * logical OR\\
\hline
\end{tabular}
\end{center}
(*) Starred explanations indicate that the operator requires integer
arguments.

Logical AND (\&\&) and OR ($|$$|$) short-circuit the way they do in C.  That is,
the second \&\& operand is not evaluated if the first is false; the second $|$$|$
operand is not evaluated if the first is true.
\subsubsection{Ternary}
There is a single ternary operator:


\begin{center}
\begin{tabular}{|ccl|} \hline
\multicolumn{3}{|c|}{Ternary Operator} \\
Symbol & Example & Explanation \\ \hline
\verb~?:~ & \verb~a?b:c~ & ternary operation\\
\hline
\end{tabular}
\end{center}
The ternary operator behaves as it does in C.  The first argument (a), which
must be an integer, is evaluated.  If it is true (non-zero), the second
argument (b) is evaluated and returned; otherwise the third argument (c) is
evaluated and returned.

The ternary operator is very useful both in constructing piecewise functions
and in plotting points only when certain conditions are met.

Examples:

Plot a function that is to equal sin(x) for 0 $<$= x $<$ 1, 1/x for 1 $<$= x $<$ 2,
and undefined elsewhere:

\begin{verbatim}
       f(x) = 0<=x & x<1 ? sin(x) : 1<=x & x<2 ? 1/x : 1/0
       plot f(x)
\end{verbatim}

Note that {\bf gnuplot} quietly ignores undefined values, so the final branch of
the function (1/0) will produce no plottable points.  Note also that it is
plotted as a continuous function across the discontinuity if a line style is
used.  If you want it to be plotted discontinuously, create separate
functions for the two pieces.

For data in a file, plot the average of the data in columns 2 and 3 against
the datum in column 1, but only if the datum in column 4 is non-negative:

\begin{verbatim}
       plot 'file' using 1:( $4<0 ? 1/0 : ($2+$3)/2 )
\end{verbatim}

Please see {\bf plot data-file using} for an explanation of the {\bf using} syntax.
\section{Fit}
This implementation incorporates the capability of nonlinear least squares
fitting using the Marquardt-Levenberg Algorithm.  It may fit any user-defined
function to any set of data pairs (x,y).  x, y and the function's return type
MUST be real!  Any variable occurring in the function body may serve as a fit
parameter (fitting functions without adjustable parameters make no sense).

Syntax:
\begin{verbatim}
        fit {range} <function> '<datafile>' {datafile-modifiers} \
            via {'<parameter file>' | <var1>,<var2>,...}
\end{verbatim}

Notice that {\bf via} is now a required keyword, to distinguish it from a scanf
format string.

\{[range]\} is [ \{variable=\} \{ $<$min$>$ \} \{ :$<$max$>$ \} ], allowing the range of the
fit to be limited temporarily in a manner analogous to {\bf plot}.  $<$function$>$ is
any valid {\bf gnuplot} expression, although it is usual to use a previously
user-defined function of the form f(x).  $<$datafile$>$ is treated as in the
{\bf plot} command.  All the modifiers for datafiles ({\bf using}, {\bf every},...) in
{\bf plot} are available here---see {\bf plot datafile} for full details.  The
default column for x is 1 for y is 2.  They may be changed by the {\bf using x:y}
mechanism.  If a third column or expression is specified with {\bf using},
uncertainties are read for each y value, to be used as weights during the
fit.  Otherwise all data are weighted equally.  The start parameters may be
specified in a (load-) file wherein each line is of the form:

\begin{verbatim}
   varname = value
\end{verbatim}

Comments, marked by '\#', and blank lines are permissible.  The form

\begin{verbatim}
   varname = value       # FIXED
\end{verbatim}

means that the variable is treated as a {\bf fixed parameter} that is initialized
but will not be adjusted.  It is not necessary (but sometimes useful for
clarity) to specify them at all.  The keyword '\# FIXED' has to appear in
exactly this form.

The other means of specifying the adjustable parameters is to provide a
comma-separated list of variable names after the {\bf via} keyword.  If any of
these variables do not yet exist within the current {\bf gnuplot} session, they
are created with an initial value of 1.0, but the fit is more likely to
converge if a more appropriate starting value is given.  If this form is
used, it may prove beneficial to iterate the fit, allowing only one or two
variables to be adjusted at a time until a reasonably close fit is obtained,
before allowing {\bf fit} to vary all parameters.

After each iteration step, detailed information is given about the fit's
state, both on the screen and on a logfile ``fit.log''.  This file will never
be erased but always appended to so that the fit's history isn't lost.  After
each iteration step, the fit may be interrupted by pressing Ctrl-C (any key
BUT Ctrl-C under MSDOS and Atari Multitasking Systems).  Then you have the
options of stopping (and accepting the current parameter values), continuing
the iteration of the fit, or executing a {\bf gnuplot} command specified by an
environment variable FIT\_SCRIPT.  A {\bf plot} or {\bf load} command may be useful in
this context.

Special {\bf gnuplot} variables:
\begin{verbatim}
   FIT_INDEX  contains the current data point number during execution,
              starting with 1.  You may use it in your fit function to
              implement multiple-branch fits.
   FIT_LIMIT  may be specified to change the default epsilon limit (1e-5).
              When the sum of squared residuals changes between two iteration
              steps by less than a factor of this number, the fit is
              considered to have 'converged'.
\end{verbatim}

(FIT\_SKIP was available in previous released of gnufit.  Its functionality
is now obtained using the {\bf every} modifier for datafiles.)

Environment variables:
\begin{verbatim}
   FIT_LOG    changes the logfile's path from './fit.log' (write permission
              is necessary).
   FIT_SCRIPT specifies a command to be executed after an user interrupt.
\end{verbatim}

Examples:
\begin{verbatim}
   f(x) = a*x**2 + b*x + c
   fit f(x) 'measured.dat' via 'start.par'
   fit f(x) 'measured.dat' using 3:($7-5) via 'start.par'
   fit f(x) './data/trash.dat' using 1:2:3 via a, b, c
\end{verbatim}

SEE ALSO: {\bf update}
\section{Help}
The {\bf help} command displays on-line help. To specify information on a
particular topic use the syntax:

\begin{verbatim}
        help {<topic>}
\end{verbatim}

If $<$topic$>$ is not specified, a short message is printed about {\bf gnuplot}.
After help for the requested topic is given, a menu of subtopics is given;
help for a subtopic may be requested by typing its name, extending the help
request.  After that subtopic has been printed, the request may be extended
again or you may go back one level to the previous topic.  Eventually, the
{\bf gnuplot} command line will return.

If a question mark (?) is given as the topic, the list of topics currently
available is printed on the screen.
\section{If}
The {\bf if} command allows commands to be executed conditionally.

Syntax:
\begin{verbatim}
        if (<condition>) <command-line>
\end{verbatim}

$<$condition$>$ will be evaluated.  If it is true (non-zero), then the command(s)
of the $<$command-line$>$ will be executed.  If $<$condition$>$ is false (zero), then
the entire $<$command-line$>$ is ignored.  Note that use of ';' to allow multiple
commands on the same line will NOT end the conditionalized commands.

Examples:

\begin{verbatim}
     pi=3
     if (pi!=acos(-1)) pause 0 "?Fixing pi!";pi=acos(-1);show variables
\end{verbatim}

will display:

\begin{verbatim}
     ?Fixing pi!
\end{verbatim}

\begin{verbatim}
             Variables:
             pi = 3.14159
\end{verbatim}
but
\begin{verbatim}
     if (1==2) pause 0 "Never see this";pause 0 "Or this either"
\end{verbatim}

will not display anything.
\section{Load}
The {\bf load} command executes each line of the specified input file as if it
had been typed in interactively.  Files created by the {\bf save} command can
later be {\bf load}ed.  Any text file containing valid commands can be created
and then executed by the {\bf load} command.  Files being {\bf load}ed may themselves
contain {\bf load} or {\bf call} commands.  See {\bf comment} for information about
comments in commands.

The {\bf load} command MUST be the last command on a multi-command line.

Syntax:
\begin{verbatim}
        load "<input-file>"
\end{verbatim}

The name of the input file must be enclosed in quotes.

Examples:

\begin{verbatim}
        load 'work.gnu'
        load "func.dat"
\end{verbatim}

The {\bf load} command is performed implicitly on any file names given as
arguments to {\bf gnuplot}.  These are loaded in the order specified, and
then {\bf gnuplot} exits.  See also {\bf call}.
\section{Pause}
The {\bf pause} command displays any text associated with the command and then
waits a specified amount of time or until the carriage return is pressed.
{\bf pause} is especially useful in conjunction with {\bf load} files.

Syntax:
\begin{verbatim}
        pause <time> {"<string>"}
\end{verbatim}

$<$time$>$ may be any integer constant or expression.  Choosing -1 will wait
until a carriage return is hit, zero (0) won't pause at all, and a positive
integer will wait the specified number of seconds.

Note: Since {\bf pause} is not part of the plot, it may interact with different
device drivers differently (depending upon how text and graphics are mixed).

Examples:
\begin{verbatim}
        pause -1    # Wait until a carriage return is hit
        pause 3     # Wait three seconds
        pause -1  "Hit return to continue"
        pause 10  "Isn't this pretty?  It's a cubic-spline."
\end{verbatim}

\section{Plot}
{\bf plot} and {\bf splot} are the primary commands of the program. They plot
functions and data in many, many ways.  {\bf plot} is used to plot 2-d
functions and data, while {\bf splot} plots 3-d surfaces and data.

Syntax:
\begin{verbatim}
     plot {ranges} {<function> | {"<datafile>" {datafile-modifiers}}} \
             {title} {style} {, {second,} <function> {title} {style}...}
     splot {ranges} {<function> | {"<datafile>" {datafile-modifiers}}} \
             {title} {style} {, <function> {title} {style}...}
\end{verbatim}

where either a $<$function$>$ or the name of a data file enclosed in quotes is
supplied.  A function is a mathematical expression, or a pair ({\bf plot}) or
triple ({\bf splot}) of mathematical expressions in the case of parametric
functions.  It is also possible to insert user-defined function definitions
and variable assignments into the list of plots.

For {\bf plot} there are two independent sets of axes available: the keywords
{\bf first} and {\bf second} can be used to change the axes for which the following
plots should be scaled.  {\bf first} refers to the axes on the bottom and
left; {\bf second} to those on the top and right.  Ranges specified on the {\bf plot}
command apply only to the first set of axes.

The {\bf second} option has not been implemented for {\bf splot}.

{\bf plot} and {\bf splot} commands can be as simple as

\begin{verbatim}
        plot sin(x)
\end{verbatim}

and

\begin{verbatim}
        splot x * y
\end{verbatim}

or as complex as (!)

\begin{verbatim}
 plot [t=1:10] [-pi:pi*2] tan(t), "data.1" using 2:($3/$4) with lines, \
       f(x)=x**p, p=2, second, f(t) with points
\end{verbatim}
\subsection{Data-file}
Discrete data contained in a file can be displayed by specifying the name of
the data file (enclosed in quotes) on the {\bf plot} or {\bf splot} command line.

Syntax:
\begin{verbatim}
        plot '<file_name>' {binary} {index <index list>} \
         {every <every list>} {thru <thru list>} {using <using list>}
\end{verbatim}

The modifiers {\bf binary}, {\bf index}, {\bf every}, {\bf thru}, and {\bf using} are discussed
separately.  In brief, {\bf index} selects which data sets in a multi-data-set
file are to be plotted, {\bf every} selects which lines within a single data set
are to be plotted, {\bf using} determines how the columns within a single line
are to be interpreted, {\bf thru} is a special case of {\bf using}, and {\bf binary} is a
flag for {\bf splot} indicating that the file is binary.

Data files should contain one data point per line.  Lines beginning with \#
(or ! on VMS) will be treated as comments and ignored.  For {\bf plot}s, each
data point represents an (x,y) pair.  For {\bf splot}s, each point is an (x,y,z)
triple.  For {\bf plot}s with error bars (see {\bf set style errorbars}), each data
point is (x,y,ydelta), (x,y,ylow,yhigh), (x,y,xdelta), (x,y,xlow,xhigh), or
(x,y,xlow,xhigh,ylow,yhigh).  In all cases, the numbers on each line of a
data file must be separated by white space (one or more blanks or tabs),
unless a format specifier is provided by the {\bf using} option.  This white
space divides each line into columns.

For {\bf plot}s, only one column (the y value) need be provided.  For {\bf splot}s,
provide either one column (z) or three (x,y,z).  (It is no longer necessary
to specify {\bf parametric} mode for three-column splots.)  If x (and y) are
omitted, {\bf gnuplot} provides integer values starting at 0.

In {\bf s/plot} datafiles, blank lines (lines with no characters other than a
line feed or carriage return) are significant---pairs of blank lines separate
{\bf index}es (see {\bf plot datafile index}).  Data separated by double blank lines
are treated as if they were in separate data files.

Single blank lines separate points in a {\bf plot}, or isolines in a {\bf splot}.
No line will join points separated by a blank line in either a {\bf plot} or
{\bf splot}.  For {\bf splot}, if all isolines (groups of contiguous points) are of
equal length, {\bf gnuplot} will draw cross-isolines in the opposite direction.
This is termed ``grid data'', and is required for contouring ({\bf set contour})
and hidden-line removal ({\bf set hidden3d}).

If autoscaling has been enabled ({\bf set autoscale}), the axes are automatically
extended to include all datapoints, with a whole number of tic marks if tics
are being drawn.  This has two consequences: i) For {\bf splot}, the corner of
the surface may not coincide with the corner of the base.  In this case, no
vertical line is drawn.  ii) When plotting data with the same x range on a
dual-axis plot, the x co-ordinates may not coincide if the x2tics are not
being drawn.  This is because the x axis has been autoextended to a whole
number of tics, but the x2 axis has not.  The following example illustrates
the problem:

\begin{verbatim}
      reset; plot first, '-', second, '-'
      1 1
      19 19
      e
      1 1
      19 19
      e
\end{verbatim}
\subsubsection{Binary}
In previous versions, {\bf gnuplot} dynamically detected binary data files.  It
is now necessary to specify the keyword {\bf binary} directly after the filename.
Currently, binary data is supported only for {\bf splot}, since a format for
binary data in 2-d has not been designed.

Single precision floats are stored in a binary file as follows:

\begin{verbatim}
      <ncols> <x0> <x1> <x2> ...
      <y0> <z0,0> <z0,1> <z0,2> ...
      <y1> <z1,0> <z1,1> <z1,2> ...
\end{verbatim}

which are converted into triplets:

\begin{verbatim}
      <x0> <y0> <z0,0>
      <x0> <y1> <z0,1>
      <x0> <y2> <z0,2>
\end{verbatim}

\begin{verbatim}
      <x1> <y0> <z1,0>
      <x1> <y1> <z1,1>
      <x1> <y2> <z1,2>
\end{verbatim}

These triplets are then converted into {\bf gnuplot} iso-curves and then
{\bf gnuplot} proceeds in the usual manner to do the rest of the plotting.

A collection of matrix and vector manipulation routines (in C) is provided
in {\bf binary.c}.  The routine to write binary data is

\begin{verbatim}
 int fwrite_matrix(file,m,nrl,nrl,ncl,nch,row_title,column_title)
\end{verbatim}

An example of using these routines is provided in the file {\bf bf\_test.c}, which
generates binary files for the demo file {\bf demo/binary.dem}.

The {\bf index} keyword is not supported, since the file format allows only one
surface per file.  The {\bf every} and {\bf using} filters are supported.  {\bf using}
operates as if the data were read in the above triplet form.
\subsubsection{Every}
The {\bf every} keyword allows a periodic sampling of a data set to be plotted.

Syntax:
\begin{verbatim}
      plot 'file' every a{:b{:c{:d}}}
\end{verbatim}

This selects every a-th point in every b'th (iso)line, starting at point c in
line d.  To plot a single line from a 3-d datafile, one trick is to set d to
the required line, and set b very large, so that no subsequent lines will be
selected.  If {\bf every} is not specified, all points are plotted.

Following C indexing, the first point (and the first isoline) are assigned
the index 0.
\subsubsection{Example}
This example compares the data in the file population.dat to a theoretical
curve:

\begin{verbatim}
        pop(x) = 103*exp((1965-x)/10)
        plot [1960:1990] 'population.dat', pop(x)
\end{verbatim}

The file population.dat might contain:

\begin{verbatim}
        # Gnu population in Antarctica since 1965
        1965   103
        1970   55
        1975   34
        1980   24
        1985   10
\end{verbatim}



A simple example of plotting a 3-d data file is

\begin{verbatim}
        splot 'glass.dat'
\end{verbatim}

where the file datafile.dat might contain:

\begin{verbatim}
        # The valley of the Gnu.
        0 0 10
        0 1 10
        0 2 10
\end{verbatim}

\begin{verbatim}
        1 0 10
        1 1 5
        1 2 10
\end{verbatim}

\begin{verbatim}
        2 0 10
        2 1 1
        2 2 10
\end{verbatim}

\begin{verbatim}
        3 0 10
        3 1 0
        3 2 10
\end{verbatim}

Note datafile.dat defines a 4 by 3 grid ( 4 rows of 3 points each ).  Rows
are separated by blank lines.

Note also that the x value is held constant within each isoline.  If you
instead keep y constant, and plot with hidden-line removal enabled, you will
find that the surface is drawn 'inside-out'.

Actually it is not necessary to keep the x values constant within an isoline,
nor is it necessary to keep the y values the same along the perpendicular
isolines.  {\bf gnuplot} requires only that the number of points be the same
along each isoline.
\subsubsection{Index}
The {\bf index} keyword allows only some of the data sets in a multi-data-set
file to be plotted.

Syntax:
\begin{verbatim}
     plot 'file' index m{{:n}:p}
\end{verbatim}

Data sets (surfaces for {\bf splot}) are separated by pairs of blank lines.
{\bf index m} selects only set m; {\bf index m:n} selects sets in the range m to n;
and {\bf index m:n:p} selects indices m, m+p, m+2p, etc., but stopping at n.
Following C indexing, the index 0 is assigned to the first data set in
the file.  Specifying too large an index results in an error message.  If
{\bf index} is not specified, all sets are plotted.

Example:
\begin{verbatim}
         plot 'file' index 4:5
\end{verbatim}
\subsubsection{Thru}
The {\bf thru} function is provided for backward compatibility.

Syntax:
\begin{verbatim}
        plot 'file' thru f(x)
\end{verbatim}

It is equivalent to {\bf plot 'file' using 1:(f(\$2))}.  While the latter appears
more complex, it is much more flexible.

The more natural

\begin{verbatim}
  plot 'file' thru f(y)
\end{verbatim}

also works (i.e. you can use y as the dummy variable).

{\bf thru} is parsed for {\bf splot} and {\bf fit} but has no effect.
\subsubsection{Special-filenames}
A special filename of {\bf '-'} specifies that the data are inline; i.e., they
follow the command.  Only the data follow the command; {\bf plot} options like
filters, titles, and line styles remain on the 'plot' command line.  This is
similar to $<$$<$ in unix shell script, and \$DECK in VMS DCL.  The data are
entered as though they are being read from a file, one data point per record.
The letter ``e'' at the start of the first column terminates data entry.  The
{\bf using} option can be applied to these data---using it to filter them through
a function might make sense, but selecting columns probably doesn't!

N.B.---use of

\begin{verbatim}
  plot '-' ; ... ; replot
\end{verbatim}

is not recommended---{\bf gnuplot} does not store the inline data internally.
Since {\bf replot} appends new information to the previous {\bf plot} and then
executes the modified command, the {\bf '-'} will ask once more for the data.
{\bf '-'} is intended for situations where it is useful to have data and commands
together, e.g., when {\bf gnuplot} is run as a sub-process of some front-end
application.  Some of the demos, for example, might use this feature.

A blank filename ('') specifies that the previous filename should be reused.
This can be useful with things like

\begin{verbatim}
 plot 'a/very/very/long/filename' using 1:2, '' using 1:3, '' using 1:4
\end{verbatim}

On some computer systems with a popen function (Unix), the datafile can be
piped through a shell command by starting the file name with a '$<$'.  For
example

\begin{verbatim}
        pop(x) = 103*exp(-x/10)
        plot "< awk '{print $1-1965, $2}' population.dat", pop(x)
\end{verbatim}

would plot the same information as the first population example but with
years since 1965 as the x axis.  If you want to execute this example, you
have to delete all comments from the data file above or substitute the
following command for the first part of the command above (the part up to
the comma):

\begin{verbatim}
        plot "< awk '$0 !~ /^#/ {print $1-1965, $2}' population.dat"
\end{verbatim}

While this approach is most flexible, it is possible to achieve simple
filtering with the {\bf using} or {\bf thru} keywords.
\subsubsection{Using}
The most common datafile modifier is {\bf using}.

Syntax:
\begin{verbatim}
        plot 'file' using { spec:spec:... } {'format'}
\end{verbatim}

If a format is specified, each datafile line is read using the c library's
scanf function, with the specified format string.  Otherwise the line is read
and broken into columns at spaces or tabs.  A format cannot be specified if
time-format data is being used  (see {\bf set data time}).

The resulting array of data is then sorted into columns according to the
specs.  Each spec is either a simple column number, which selects the datum,
or an expression enclosed in round brackets (parentheses).  The expression
can use \$1 to access the first item read, \$2 for the second item, and so on.
It can also use {\bf column(x)} and {\bf valid(x)} where x is an arbitrary expression
resulting in an integer.  {\bf column(x)} returns the x'th datum; {\bf valid(x)}
tests that datum x is a valid number.  A column number of 0 generates a
number increasing (from zero) with each point, reset at double blank lines.

{\bf plot 'file' using 1} is identical to {\bf plot 'file' using 0:1}.

N.B.---the {\bf call} command also uses \$'s as a special character.

The interpretation of the columns depends on the plot and style.  For
{\bf splot}, a single column is z, or three columns are (x,y,z) (unless {\bf set
mapping} has been used).  For {\bf plot}, a single column is y.  For {\bf plot} or
{\bf fit}, the first two columns are x and y; additional columns are usually
errors in x and/or y.  See {\bf set style} for more details about the structure
of files containing error information.

Examples:

This creates a plot of the sum of the 2nd and 3rd data against the first:
(The format string specifies comma- rather than space-separated columns.)
\begin{verbatim}
    plot 'file' using 1:($2+$3) '%lf,%lf,%lf'
\end{verbatim}

In this example the data are read from the file ``MyData'' using a more
complicated format:
\begin{verbatim}
    plot "MyData" using "%*lf%lf%*20[^\n]%lf"
\end{verbatim}

The meaning of this format is:

\begin{verbatim}
      %*lf        ignore the first number
      %lf         read in the second and assign to x
      %*20[^\n]   ignore 20 non-newline characters
      %lf         read in the y value
\end{verbatim}

Note that the use of newline ($\backslash$n) requires use of double-quotes rather than
single-quotes.

One trick is to use the ternary {\bf ?:} operator to filter data:

\begin{verbatim}
      plot 'file' using 1:($3>10 ? $2 : 1/0)
\end{verbatim}

which plots the datum in column two against that in column one provided
the datum in column three exceeds ten.  {\bf 1/0} is undefined; {\bf gnuplot}
quietly ignores undefined points, so unsuitable points are suppressed.

In fact, you can use a constant expression for the column number, provided
it doesn't start with an opening bracket.  Something like

\begin{verbatim}
     `using 0+`(complicated expression)
\end{verbatim}

can be used.  The crucial point is that the expression is evaluated once if
it doesn't start with a bracket, or once for each data point read if it does
start with a bracket.

If timeseries data are being used, the time can span multiple columns.  The
starting column should be specified.  Note that the spaces within the time
must be included when calculating starting columns for other data.  E.g., if
the first element on a line is a time with an embedded space, the y value
should be specified as column three.

It should be noted that {\bf plot 'file', plot 'file' using 1:2}, and {\bf plot
'file' using (\$1):(\$2)} can be subtly different: 1) if {\bf file} has some lines
with one column and some with two, the first will invent x values when they
are missing, the second will quietly ignore the lines with one column, and
the third will store an undefined value for lines with one point (so that in
a plot with lines, no line joins points across the bad point); 2) if a line
contains text at the first column, the first will abort the plot on an error,
but the second and third should quietly skip the garbage.

In fact, it is often possible to plot a file with lots of lines of garbage at
the top simply by specifying

\begin{verbatim}
   plot 'file' using 1:2
\end{verbatim}

If you want to leave text in your data files, it is always safe to put the
comment character (\#) in the first column of the text lines.
\subsection{Errorbars}
Error bars are supported for 2-d data file plots by reading one to
four additional columns specifying ydelta or ylow and yhigh for
yerrorbars or xdelta or xlow and xhigh for xerrorbars or xdelta, ydelta
or xlow, xhigh, ylow, yhigh for xyerrorbars or boxxyerrorbars.
No support exists for any error bars for {\bf splot}s.

In the default situation, {\bf gnuplot} expects to see three, four, or six
numbers on each line of the data file---either (x, y, ydelta),
(x, y, ylow, yhigh), (x, y, xdelta), (x, y, xlow, xhigh),
(x, y, xdelta, ydelta), or (x, y, xlow, xhigh, ylow, yhigh).  The
x co-ordinate must be specified. The order of the numbers must be
exactly as given above, though the {\bf using} qualifier can manipulate
the order and provide values for missing columns.  For example,

\begin{verbatim}
  plot 'file' with errorbars
  plot 'file' using 1:2:(sqrt($1)) with xerrorbars
  plot 'file' using 1:2:($1-$3):($1+$3):4:5 with xyerrorbars
\end{verbatim}

The last plot is for a file with an unsupported combination of relative
x and absolute y errors. The {\bf using} spec generates absolute x min and
max from the relative error.

The y error bar is a vertical line plotted from (x, ylow) to (x, yhigh).
If ydelta is specified instead of ylow and yhigh, ylow = y - ydelta and
yhigh = y + ydelta are derived.  If there are only two numbers on the line,
yhigh and ylow are both set to y.  The x error bar is a horizontal line
computed in the same fashion.  To get lines plotted between the data points,
{\bf plot} the data file twice, once with errorbars and once with lines.

The error bar has crossbars at top and bottom unless {\bf set bar small} is used.

If autoscaling is on, the ranges will be adjusted to fit the error bars.

See {\bf plot using}, {\bf plot with}, and {\bf set style} for more information.
\subsection{Parametric}
When in parametric mode ({\bf set parametric}) mathematical expressions must be
given in pairs for {\bf plot} and in triplets for {\bf splot}:

\begin{verbatim}
        plot sin(t),t**2
\end{verbatim}
or
\begin{verbatim}
        splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
\end{verbatim}

Data files are plotted as before, except any preceding parametric function
must be fully specified before a data file is given as a plot.  In other
words, the x parametric function ({\bf sin(t)} above) and the y parametric
function ({\bf t**2} above) must not be interrupted with any modifiers or data
functions; doing so will generate a syntax error stating that the parametric
function is not fully specified.

Ranges take on a different meaning when in parametric mode.  The first range
on the {\bf plot} command is the {\bf trange}, the next is the {\bf xrange}, and the last
is the {\bf yrange}.  For {\bf splot} the order is {\bf urange}, {\bf vrange}, {\bf xrange},
{\bf yrange}, and finally {\bf zrange}.  The following {\bf plot} command shows setting
the {\bf trange} to [-pi:pi], the {\bf xrange} to [-1.3:1.3] and the {\bf yrange} to
[-1:1] for the duration of the plot:

\begin{verbatim}
        plot [-pi:pi] [-1.3:1.3] [-1:1] sin(t),t**2
\end{verbatim}

Other modifiers, such as {\bf with} and {\bf title}, may be specified only after the
parametric function has been completed:

\begin{verbatim}
        plot sin(t),t**2 title 'Parametric example' with linespoints
\end{verbatim}
\subsection{Ranges}
The optional ranges specify the region of the plot that will be displayed.

Syntax:
\begin{verbatim}
        [{<dummy-var> =} {<xmin>} { : <xmax>}] { [{<ymin>} {: <ymax>}] }
\end{verbatim}

where $<$dummy-var$>$ is the independent variable (the defaults are x and y,
but these may be changed with {\bf set dummy}) and the min and max terms can be
constant expressions.

* can be used to allow autoscaling of either of min and max.  See also
{\bf set autoscaling}

Ranges specified on the {\bf plot} or {\bf splot} command line affect only that plot;
use the {\bf set xrange}, {\bf set yrange}, etc., commands to change the default
ranges for future plots.

With time data, you must provide the range (in the same manner as the time
appears in the datafile) within quotes.  {\bf gnuplot} uses the {\bf timefmt} string
to read the value---see {\bf set timefmt}.

Examples:

This uses the current ranges:
\begin{verbatim}
        plot cos(x)
\end{verbatim}

This sets the x range only:
\begin{verbatim}
        plot [-10:30] sin(pi*x)/(pi*x)
\end{verbatim}

This is the same, but uses t as the dummy-variable:
\begin{verbatim}
        plot [t = -10 :30]  sin(pi*t)/(pi*t)
\end{verbatim}

This sets both the x and y ranges:
\begin{verbatim}
        plot [-pi:pi] [-3:3]  tan(x), 1/x
\end{verbatim}

This sets only the y range, and turns off autoscaling on both axes:
\begin{verbatim}
        plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)
\end{verbatim}

This sets xmax and ymin only:
\begin{verbatim}
        plot [:200] [-pi:]  exp(sin(x))
\end{verbatim}

This sets the x, y, and z ranges:
\begin{verbatim}
        splot [0:3] [1:4] [-1:1] x*y
\end{verbatim}

This sets the x range for a timeseries (timefmt=''\%d/\%m/\%y \%H:\%M''):
\begin{verbatim}
        plot ["1/6/93 12:00":"5/6/93 12:00"] 'timedata.dat'
\end{verbatim}
\subsection{Style}
Functions and data may be displayed in one of a large number of styles.
The {\bf with} keyword provides the means of selection.

Syntax:
\begin{verbatim}
        with <style> {<linetype> {<pointtype>}}
\end{verbatim}

where $<$style$>$ is either {\bf lines}, {\bf points}, {\bf linespoints}, {\bf impulses}, {\bf dots},
{\bf steps}, {\bf fsteps},  {\bf errorbars}, {\bf xerrorbars}, {\bf yerrorbars}, {\bf xyerrorbars},
{\bf boxes}, {\bf boxerrorbars}, {\bf boxxyerrorbars}, {\bf splines}, {\bf csplines}, {\bf bezier},
{\bf sbezier}, or {\bf vector}.  A given style may not be appropriate for both 2-D
and 3-D plots and may require additional information.  See {\bf set style
$<$style$>$} for details about each style.

Default styles are chosen with the {\bf set function style} and {\bf set data style}
commands.

By default, each function and data file will use a different line type and
point type, up to the maximum number of available types.  All terminal
drivers support at least six different point types, and re-use them, in
order, if more than six are required.  The LaTeX driver supplies an
additional six point types (all variants of a circle), and thus will only
repeat after twelve curves are plotted with points.  The PostScript drivers
({\bf postscript}) supplies a total of sixty-four.

If you wish to choose the line or point type, $<$linetype$>$ and $<$pointtype$>$ may
be specified.  These are positive integer constants (or expressions) that
specify the line type and point type to be used for the plot.

Use {\bf test} to display the types available for your terminal.

Examples:

This plots sin(x) with impulses:
\begin{verbatim}
        plot sin(x) with impulses
\end{verbatim}

This plots x*y with points, x**2 + y**2 default:
\begin{verbatim}
        splot x*y w points, x**2 + y**2
\end{verbatim}

This plots tan(x) with the default function style, ``data.1'' with lines:
\begin{verbatim}
        plot [ ] [-2:5] tan(x), "data.1" with l
\end{verbatim}

This plots ``leastsq.dat'' with impulses:
\begin{verbatim}
        plot 'leastsq.dat' w i
\end{verbatim}

This plots the data file 'population' with boxes:
\begin{verbatim}
        plot "population" with boxes
\end{verbatim}

This plots ``exper.dat'' with errorbars and lines connecting the points:
\begin{verbatim}
        plot 'exper.dat' w lines, 'exper.dat' w errorbars
\end{verbatim}

Here 'exper.dat' should have three or four data columns.

This plots x**2 + y**2 and x**2 - y**2 with the same line type:
\begin{verbatim}
        splot x**2 + y**2 with line 1, x**2 - y**2 with line 1
\end{verbatim}

This plots sin(x) and cos(x) with linespoints, using the
same line type but different point types:
\begin{verbatim}
        plot sin(x) with linesp 1 3, cos(x) with linesp 1 4
\end{verbatim}

This plots file ``data'' with points style 3:
\begin{verbatim}
        plot "data" with points 1 3
\end{verbatim}
Note that the line style must be specified when specifying the point
style, even when it is irrelevant. Here the line style is 1 and the
point style is 3, and the line style is irrelevant.

See {\bf set style} to change the default styles.
\subsection{Title}
A title of each plot appears in the key.  By default the title is the
function or file name as it appears on the plot command line.  The title
can be changed by using the {\bf title} option.  This option should precede
any {\bf with} option.

Syntax:
\begin{verbatim}
        title "<title>" | notitle
\end{verbatim}

where $<$title$>$ is the new title of the plot and must be enclosed in quotes.
The quotes will not be shown in the key.  A special character may be given as
a backslash followed by its octal value (''$\backslash$345'').  The tab character ''$\backslash$t'' is
understood.  Note that backslash processing occurs only for strings enclosed
in double quotes---use single quotes to prevent such processing.

Examples:

This plots y=x with the title 'x':
\begin{verbatim}
        plot x
\end{verbatim}

This plots the ``glass.dat'' file with the title 'surface of revolution':
\begin{verbatim}
        splot "glass.dat" title 'surface of revolution'
\end{verbatim}

This plots x squared with title ``x\verb+^+2'' and ``data.1'' with title 'measured
data':
\begin{verbatim}
        plot x**2 title "x^2", "data.1" t 'measured data'
\end{verbatim}

The title can be omitted from the key by using the keyword {\bf notitle}.  This
can be useful when some curves are plotted solely for decoration.  For
example, if one wanted a circular border for a polar plot, he could say:

Example:
\begin{verbatim}
       set polar
       plot my_function(x), 1 notitle
\end{verbatim}

This would generate a key entry for ``my\_function'' but not for ``1''.  See the
poldat.dem example.  {\bf title ''}  is equivalent to {\bf notitle}.  {\bf title ' '}
can be used to have a sample with no text.
\section{Print}
The {\bf print} command prints the value of $<$expression$>$ to the screen.

Syntax:
\begin{verbatim}
        print <expression>
\end{verbatim}

See {\bf expressions}.
\section{Pwd}
The {\bf pwd} command prints the name of the working directory to the screen.

Syntax:
\begin{verbatim}
        pwd
\end{verbatim}
\section{Quit}
The {\bf exit} and {\bf quit} commands and END-OF-FILE character will exit {\bf gnuplot}.
Each of these commands will clear the output device (as does the {\bf clear}
command) before exiting.
\section{Replot}
The {\bf replot} command without arguments repeats the last {\bf plot} or {\bf splot}
command.  This can be useful for viewing a plot with different {\bf set}
options, or when generating the same plot for several devices.

Arguments specified after a {\bf replot} command will be added onto the last
{\bf plot} or {\bf splot} command (with an implied ',' separator) before it is
repeated.  {\bf replot} accepts the same arguments as the {\bf plot} and {\bf splot}
commands except that ranges cannot be specified.  Thus you can use {\bf replot}
to plot a function against the second axes if the previous command was {\bf plot}
but not if it was {\bf splot}, and similarly you can use {\bf replot} to add a plot
from a binary file only if the previous command was {\bf splot}.

N.B.---use of

\begin{verbatim}
  plot '-' ; ... ; replot
\end{verbatim}

is not recommended---{\bf gnuplot} does not store the inline data internally.
Since {\bf replot} appends new information to the previous {\bf plot} and then
executes the modified command, the {\bf '-'} will ask once more for the data.
{\bf '-'} is intended for situations where it is useful to have data and commands
together, e.g., when {\bf gnuplot} is run as a sub-process of some front-end
application.  Some of the demos, for example, might use this feature.

See {\bf command-line-editing} for ways to edit the last {\bf plot}
({\bf splot}) command.
\section{Reread}
The {\bf reread} command causes the current {\bf gnuplot} command file, as specified
by a {\bf load} command or on the command line, to be reset to its starting
point before further commands are read from it.  This essentially implements
an endless loop of the commands from the beginning of the command file to
the {\bf reread} command.  The {\bf reread} command has no effect if input from
standard input.
\section{Reset}
The {\bf reset} command causes all options that can be set with the {\bf set}
command to take on their default values.  The only exceptions are that the
terminal set with {\bf set term} and the output file set with {\bf set output} are
left unchanged.  This command is useful, e.g., to restore the default
settings at the end of a command file, or to return to a defined state after
lots of settings have been changed within a command file.  Please refer to
the {\bf set} command to see the default values that the various options take.
\section{Save}
The {\bf save} command saves user-defined functions, variables, {\bf set} options,
or all three, plus the last {\bf plot} ({\bf splot}) command to the specified file.

Syntax:
\begin{verbatim}
        save  {<option>} "<filename>"
\end{verbatim}

where $<$option$>$ is {\bf functions}, {\bf variables} or {\bf set}. If no option is used,
{\bf gnuplot} saves functions, variables, {\bf set} options and the last {\bf plot}
({\bf splot}) command.

{\bf save}d files are written in text format and may be read by the {\bf load}
command.

The filename must be enclosed in quotes.

Examples:

\begin{verbatim}
        save "work.gnu"
        save functions 'func.dat'
        save var 'var.dat'
        save set "options.dat"
\end{verbatim}
\section{Set-show}
The {\bf set} command sets LOTS of options.

The {\bf show} command shows their settings.  {\bf show all} shows all the
settings.
\subsection{Angles}
By default, {\bf gnuplot} assumes the independent variable in polar plots is in
units of radians.  If {\bf set angles degrees} is specified before {\bf set polar},
then the default range is [0:360] and the independent variable has units of
degrees.  This is particularly useful for plots of data files.  The angle
setting also applies to 3-d mapping as set via the {\bf set mapping} command.

Syntax:
\begin{verbatim}
        set angles { degrees | radians }
        show angles
\end{verbatim}

The angle specified in {\bf set grid polar} is also read and displayed in the
units specified by {\bf set angles}.

{\bf set angles} has no effect on the arguments of machine-defined functions
(sin(x), cosh(x), besj0(x), etc.); neither does it affect the result of
inverse trigonometric functions, e.g. atan(x).  These are always given in
radians.
\subsection{Arrow}
Arbitrary arrows can be placed on a plot using the {\bf set arrow} command.

Syntax:
\begin{verbatim}
         set arrow {<tag>} {from <position>} \
                           {to <position>} {{no}head} \
                           {<linestyle>}
         set noarrow {<tag>}
         show arrow
\end{verbatim}


Unspecified co-ordinates default to 0.  The endpoints can be specified in
one of four co-ordinate systems---{\bf first} or {\bf second} axes, {\bf graph} or
{\bf screen}.  See {\bf set co-ordinates} for details.  Arrows outside the screen
boundaries are permitted but may cause device errors.

$<$tag$>$ is an integer that identifies the arrow.  If no tag is given, the
lowest unused tag value is assigned automatically.  The tag can be used to
delete or change a specific arrow.  To change any attribute of an existing
arrow, use the {\bf set arrow} command with the appropriate tag and specify the
parts of the arrow to be changed.

Specifying {\bf nohead} produces an arrow drawn without a head---a line segment.
This gives you yet another way to draw a line segment on the graph.  By
default, arrows have heads.

{\bf linestyle} allows specification of the line style to be used for the arrow.

Examples:

To set an arrow pointing from the origin to (1,2), use:
\begin{verbatim}
         set arrow to 1,2
\end{verbatim}
To set an arrow from bottom left of plotting area to (-5,5,3), and tag the
arrow number 3, use:
\begin{verbatim}
         set arrow 3 from graph 0,0 to -5,5,3
\end{verbatim}
To change the preceding arrow to end at 1,1,1, without an arrow head, use:
\begin{verbatim}
         set arrow 3 to 1,1,1 nohead
\end{verbatim}
To draw a vertical line from the bottom to the top of the graph at x=3, use:
\begin{verbatim}
         set arrow from 3, graph 0 to 3, graph 1 nohead
\end{verbatim}
To delete arrow number 2 use:
\begin{verbatim}
         set noarrow 2
\end{verbatim}
To delete all arrows use:
\begin{verbatim}
         set noarrow
\end{verbatim}
To show all arrows (in tag order) use:
\begin{verbatim}
         show arrow
\end{verbatim}
\subsection{Autoscale}
Autoscaling may be set individually on the x, y or z axis or globally on all
axes. The default is to autoscale all axes.

Syntax:
\begin{verbatim}
        set autoscale <axes>{min|max}
        set noautoscale <axes>{min|max}
        show autoscale
\end{verbatim}

where $<$axes$>$ is either {\bf x}, {\bf y}, {\bf z}, {\bf x2}, {\bf y2} or {\bf xy}.  A keyword with
{\bf min} or {\bf max} appended (this cannot be done with {\bf xy}) tells {\bf gnuplot} to
autoscale just the minimum or maximum of that axis.  If no keyword is given,
all axes are autoscaled.

When autoscaling, the plot range is automatically computed and the dependent
axis (y for a {\bf plot} and z for {\bf splot}) is scaled to include the range of the
function or data being plotted.

If autoscaling of the dependent axis (y or z) is not set, the current y or z
range is used.

Autoscaling the independent variables (x for {\bf plot} and x,y for {\bf splot}) is a
request to set the domain to match any data file being plotted.  If there are
no data files, autoscaling an independent variable has no effect.  In other
words, in the absence of a data file, functions alone do not affect the x
range (or the y range if plotting z = f(x,y)).

Please see {\bf set range} for additional information about ranges.

The behavior of autoscaling remains consistent in parametric mode, (see {\bf set
parametric}).  However, there are more dependent variables and hence more
control over x, y, and z plot scales.  In parametric mode, the independent
or dummy variable is t for {\bf plot}s and u,v for {\bf splot}s.  {\bf autoscale} in
parametric mode, then, controls all ranges (t, u, v, x, y, and z) and allows
x, y, and z to be fully autoscaled.

When tics are displayed on second axes but no plot has been specified for
those axes, x2range and y2range are inherited from xrange and yrange.  This
is done \_before\_ xrange and yrange are autoextended to a whole number of
tics, which can cause unexpected results.

Examples:

This sets autoscaling of the y axis (other axes are not affected):
\begin{verbatim}
        set autoscale y
\end{verbatim}

This sets autoscaling only for the minimum of the y axis (the maximum of the
y axis and the other axes are not affected):
\begin{verbatim}
        set autoscale ymin
\end{verbatim}

This sets autoscaling of the x and y axes:
\begin{verbatim}
        set autoscale xy
\end{verbatim}

This sets autoscaling of the x, y, z, x2 and y2 axes:
\begin{verbatim}
        set autoscale
\end{verbatim}

This disables autoscaling of the x, y, z, x2 and y2 axes:
\begin{verbatim}
        set noautoscale
\end{verbatim}

This disables autoscaling of the z axis only:
\begin{verbatim}
        set noautoscale z
\end{verbatim}
\subsubsection{Parametric mode}
When in parametric mode ({\bf set parametric}), the  xrange is as fully scalable
as the y range.  In other words, in parametric mode the x axis can be
automatically scaled to fit the range of the parametric function that is
being plotted.  Of course, the y axis can also be automatically scaled just
as in the non-parametric case.  If autoscaling on the x axis is not set, the
current x range is used.

Data files are plotted the same in parametric and nonparametric mode.
However, there is a difference in mixed function and data plots: in
non-parametric mode with autoscaled x, the x range of the datafile controls
the x range of the functions; in parametric mode it has no influence.

For completeness a last command {\bf set autoscale t} is accepted.  However, the
effect of this ``scaling'' is very minor.  When {\bf gnuplot} determines that the
t range would be empty, it makes a small adjustment if autoscaling is true.
Otherwise, {\bf gnuplot} gives an error.  Such behavior may, in fact, not be very
useful and the command {\bf set autoscale t} is certainly questionable.

{\bf splot} extends the above ideas as you would expect.  If autoscaling is set,
then x, y, and z ranges are computed and each axis scaled to fit the
resulting data.
\subsection{Bar}
The {\bf set bar} command controls the tics at the ends of errorbars.

Syntax:
\begin{verbatim}
        set bar {small | large | <size>}
        show bar
\end{verbatim}

{\bf small} is a synonym for 0.0, and {\bf large} for 1.0.
The default is 1.0 if no size is given.
\subsection{Bmargin}
The command {\bf set bmargin} sets the size of the bottom margin.  Please see
{\bf set margins} for details.
\subsection{Border}
The {\bf set border} and {\bf set noborder} commands control the display of the plot
borders for the {\bf plot} and {\bf splot} commands.  The borders are encoded in a
twelve-bit integer: the bottom 4 bits control the border for {\bf plot} and the
sides of the base for {\bf splot}.  The next 4 bits control the verticals in
{\bf splot}, while the top 4 bits control the edges on top of the {\bf splot}.  The
default is 31, which is all four sides for {\bf plot}, and base and z axis for
{\bf splot}.

Syntax:
\begin{verbatim}
        set border    (turns on all borders)
        set border 3  (only SOUTHWEST borders)
        set border 4095   (complete box around splot)
        set border 127+256+512  (partial box omitting front vertical)
        set noborder
        show border
\end{verbatim}

To have tics on edges other than bottom and left, disable the usual
tics and enable the second axes.

\begin{verbatim}
        set border 12 (only NORTHEAST borders)
        set noxtics; set noytics; set x2tics; set y2tics
\end{verbatim}
\subsection{Boxwidth}
The {\bf set boxwidth} command is used to set the default width of boxes in the
{\bf boxes} and {\bf boxerrorbars} styles.

Syntax:
\begin{verbatim}
         set boxwidth {<width>}
         show boxwidth
\end{verbatim}

If a data file is plotted without the width being specified in the third,
fourth, or fifth column, or if a function is plotted, the width of each box
is set by the {\bf set boxwidth} command.  (If a width is given after the {\bf set
boxwidth} command, the one taken from the data is used.)  If the width is
not specified in one of these ways, the width of each box will be calculated
automatically so that it touches the adjacent boxes.  In a four-column data
set, the fourth column will be interpreted as the box width unless the width
is set to -2.0, in which case the width will be calculated automatically.
See {\bf boxerrorbars} or {\bf set style} for more details.

To set the box width to automatic use the command
\begin{verbatim}
         set boxwidth
         set boxwidth -2  (4-col data)
\end{verbatim}

The same effect can be achieved with the {\bf using} keyword in {\bf plot}:
\begin{verbatim}
         plot 'file' using 1:2:3:4:(-2)
\end{verbatim}
\subsection{Clabel}
{\bf gnuplot} will vary the linetype used for each contour level when clabel is
set.  When this option on (the default), a legend labels each linestyle with
the z level it represents.  It is not possible at present to separate the
contour labels from the surface key.

Syntax:
\begin{verbatim}
        set clabel { 'format' }
        set noclabel
        show clabel
\end{verbatim}

The default for the format string is \%8.3g, which gives three decimal places.
This may produce poor label alignment if the key is altered from its default
configuration.

See also {\bf set contour}.
\subsection{Clip}
{\bf gnuplot} can clip data points and lines that are near the boundaries of a
plot.

Syntax:
\begin{verbatim}
        set clip <clip-type>
        set noclip <clip-type>
        show clip
\end{verbatim}

Three clip types are supported by {\bf gnuplot}: {\bf points}, {\bf one}, and {\bf two}.
One, two, or all three clip types may be active for a single plot.

The {\bf points} clip type forces {\bf gnuplot} to clip (actually, not plot at all)
data points that fall within but too close to the boundaries.  This is done
so that large symbols used for points will not extend outside the boundary
lines.  Without clipping points near the boundaries, the plot may look bad.
Adjusting the x and y ranges may give similar results.

Setting the {\bf one} clip type causes {\bf gnuplot} to plot a line segment which has
only one of its two endpoints within the plotting region.  Only the in-range
portion of the line is drawn.  The alternative is to not draw any portion of
the line segment.

Some lines may have both endpoints out of range, but pass through the
plotting area.  Setting the {\bf two} clip-type allows the visible portion of
these lines to be drawn.

In no case is a line drawn outside the plotting area.

The defaults are {\bf noclip points}, {\bf clip one}, and {\bf noclip two}.

To check the state of all forms of clipping, use
\begin{verbatim}
        show clip
\end{verbatim}

For backward compatibility with older versions, the following forms are also
permitted:
\begin{verbatim}
       set clip
       set noclip
\end{verbatim}
{\bf set clip} is synonymous with {\bf set clip points}; {\bf set noclip} turns off all
three types of clipping.
\subsection{Cntrparam}
{\bf set cntrparam} controls the generation of contours and their smoothness for
a contour plot.

Syntax:
\begin{verbatim}
        set cntrparam { { linear | cubicspline | bspline } |
             points <n> |
             order <n> |
             levels { [ auto ] <n> |
                      discrete <z1>,<z2>, ... |
                      incremental {<start>, <incr>{, <end>} } } }
        show cntrparam
\end{verbatim}

This command controls the way contours are plotted.  $<$n$>$ should be an
integral constant expression and $<$z1$>$, $<$z2$>$ any constant expressions.
The parameters are:

{\bf linear}, {\bf cubicspline}, {\bf bspline}---Controls type of approximation or
interpolation.  If {\bf linear}, then the contours are drawn piecewise linear, as
extracted from the surface directly.  If {\bf cubicspline}, then piecewise linear
contours are interpolated to form somewhat smoother contours, but which may
undulate.  If {\bf bspline}, a guaranteed-smoother curve is drawn, which only
approximates the piecewise linear data.

{\bf points}---Eventually all drawings are done with piecewise linear strokes.
This number controls the number of points used to approximate a curve.
It is relevant only for {\bf cubicspline} and {\bf bspline} modes.

{\bf order}---Order of the bspline approximation to be used.  The bigger this
order is, the smoother the resulting contour.  (Of course, higher order
bspline curves will move further away from the original piecewise linear
data.)  This option is relevant for {\bf bspline} mode only.  Allowed values are
integers in the range from 2 (linear) to 10.

{\bf levels}---Number of contour levels.  Selection of the levels is controlled
by {\bf auto} (default), {\bf discrete}, and {\bf incremental}.  For {\bf auto}, if the
surface is bounded by zmin and zmax, contours will be generated from zmin+dz
to zmax-dz in steps of size dz, where dz = (zmax - zmin) / (levels + 1).  For
{\bf discrete}, contours will be generated at z = z1, z2 ... as specified.  The
number of discrete levels is limited to MAX\_DISCRETE\_LEVELS, defined in
plot.h to be 30.  If {\bf incremental}, contours are generated at values of z
beginning at $<$start$>$ and increasing by $<$increment$>$ until $<$end$>$ is reached.
If $<$end$>$ is not specified, MAX\_DISCRETE\_LEVELS will be generated.

Examples:
\begin{verbatim}
    set cntrparam bspline
    set cntrparam points 7
    set cntrparam order 10
    set cntrparam levels auto 5                   # 5 automatic levels
    set cntrparam levels discrete .1,1/exp(1),.9  # 3 discrete at .1,.37,.9
    set cntrparam levels incremental  0,.1,.4
    # 5 incremental levels at 0, .1, .2, .3 and .4
    set cntrparam levels 10
    # sets n = 10 retaining current setting of auto, discr. and
    # increment's start and increment value, while changing end
    set cntrparam levels incremental 100,50
    # set start = 100 and increment = 50, retaining n levels
\end{verbatim}

See also {\bf set contour} for control of where the contours are drawn, and {\bf set
clabel} for control of the format of the contour labels.
\subsection{Contour}
{\bf set contour} enables contour drawing for surfaces. This option is available
for {\bf splot} only.

Syntax:
\begin{verbatim}
        set contour { base | surface | both }
        set nocontour
\end{verbatim}

The three options specify where to draw the contours: {\bf base} draws the
contours on the grid base where the x/ytics are placed, {\bf surface} draws the
contours on the surfaces themselves, and {\bf both} draws the contours on both
the base and the surface.  If no option is provided, the default is {\bf base}.

See also {\bf set cntrparam} for the parameters that affect the drawing of
contours, and {\bf set clabel} for control of labelling of the contours.

The surface can be switched off (see {\bf set surface}), giving a contour-only
plot.  Though it is possible to set the view to give a full-page plot, good
results can be obtained by writing the contour information out to a file, and
rereading it as a 2-d datafile plot:

\begin{verbatim}
  set nosurface
  set contour
  set cntrparam ...
  set term table
  set out 'filename'
  splot ...
  set out
  # contour info now in filename
  set term <whatever>
  plot 'filename'
\end{verbatim}

In order to draw contours, the data must be organized as ``grid data''.  In
such a file all of the points for a single y value are listed, then all the
points for the next y, and so on.  A single null line (a line containing no
characters other than a carriage return and/or a line feed) separates one y
value group from the next.  See also {\bf plot datafile}.

If contours are desired from non-grid data, {\bf set dgrid3d} can be used to
create an appropriate grid.  See {\bf set dgrid3d} for more information.
\subsection{Co-ordinates}
While there is no {\bf set co-ordinates} command, the commands {\bf set arrow}, {\bf set
key}, and {\bf set label} allow you to draw something at an arbitrary position
on the graph.  This position is specified by the syntax:

\begin{verbatim}
         {first | second | graph | screen} x,\
         {first | second | graph | screen} y\
         {, {first | second | graph | screen} z}
\end{verbatim}

{\bf first} places the x, y, or z co-ordinate in the system defined by the left
and bottom axes; {\bf second} places it in the system defined by the second axes
(top and right); {\bf graph} specifies the area within the axes---0,0 is bottom
left and 1,1 is top right (for splot, 0,0,0 is bottom left of plotting area;
use negative z to get to the base---see {\bf set ticslevel}); and {\bf screen}
specifies the screen area---0,0 is bottom left and 1,1 is top right.

If the co-ordinate system is not specified, {\bf first} is used.

If one (or more) axis is timeseries, the appropriate co-ordinate should
be given as a quoted time string according to the {\bf timefmt} format string.
See {\bf set \{x,y,z\}data} and {\bf set timefmt}.
\subsection{Data style}
The {\bf set data style} command changes the default plotting style for data
plots.

Syntax:
\begin{verbatim}
        set data style <style-choice>
        show data style
\end{verbatim}

See {\bf set style} for the choices.  If no choice is given, the choices are
listed.  {\bf show data style} shows the current default data plotting style.
\subsection{Dgrid3d}
The {\bf set dgrid3d} command enables and sets the different parameters for
non-grid to grid data mapping.

Syntax:
\begin{verbatim}
        set dgrid3d {,{<row_size>}{,{<col_size>}{,<norm>}}}
        set nodgrid3d
        show dgrid3d
\end{verbatim}

By default {\bf dgrid3d} is disabled.  When enabled, 3-d data read from a file
are always treated as a scattered data set.  A grid with dimensions derived
from a bounding box of the scattered data and size as specified by the
row/col\_size parameters is created for plotting and contouring.  The grid is
equally spaced in x and y; the z values are computed as weighted averages of
the scattered points' values.

The third parameter, norm, controls the weighting: each point is weighted
inversely by its distance (from the grid point) raised to the norm power.
(Actually it's not quite the distance: the weights are given by the inverse
of dx\verb+^+norm + dy\verb+^+norm, where dx and dy are the components of the separation
of the grid point from each data point.)  Thus the closer the data point is
to a grid point, the more effect it has on that grid point.  In {\bf gnuplot},
this distance computation is optimized for norms that are powers of 2,
specifically 1, 2, 4, 8, and 16, but any non-negative integer can be used.

The {\bf dgrid3d} option is a simple low pass filter that converts scattered data
to a grid data set.  More sophisticated approaches to this problem exist and
should be used to preprocess the data outside {\bf gnuplot} if this simple
solution is found inadequate.

Examples:
\begin{verbatim}
       set dgrid3d 10,10,2
       set dgrid3d ,,4
\end{verbatim}

The first specifies that a grid of size 10 by 10 is to be constructed using
the L2 norm (a norm of 2 is to be used in the distance computation).  The
second only modifies the norm to be used to L4.

\subsection{Dummy}
The {\bf set dummy} command changes the default dummy variable names.

Syntax:
\begin{verbatim}
        set dummy <dummy-var>{,<dummy-var>}
        show dummy
\end{verbatim}

By default, {\bf gnuplot} assumes that the independent variable for the {\bf plot}
command is x, and the independent variables for the {\bf splot} command are x and
y.  They are called the dummy variables because it is just a notation to
indicate the independent variables.  It may be more convenient to call a
dummy variable by a more physically meaningful or conventional name.  For
example, when plotting time functions:

\begin{verbatim}
        set dummy t
        plot sin(t), cos(t)
\end{verbatim}

Examples:
\begin{verbatim}
        set dummy u,v
        set dummy ,s
\end{verbatim}

The second example sets the second variable to s.

The {\bf set parametric} command also changes the dummy variables (to t for
{\bf plot} and u,v for {\bf splot}).
\subsection{Encoding}
The {\bf set encoding} command selects a character encoding.  Valid values are:
\begin{verbatim}
  `default`,    which does nothing;
  `iso_8859_1`, which is used on many Unix workstations and with MS-Windows;
  `cp437`,      the standard IBM PC character encoding and
  `cp850`,      the standard alternate IBM PC character encoding.
\end{verbatim}

Syntax:
\begin{verbatim}
        set encoding <value>
        show encoding
\end{verbatim}

Please note that this is not supported on all terminal types. Current
terminals supperted are:
\begin{verbatim}
  postscript.
\end{verbatim}
\subsection{Format}
The format of the tic-mark labels can be set with the {\bf set format} command.

Syntax:
\begin{verbatim}
        set format {<axes>} {"<format-string>"}
        set format {<axes>} {'<format-string>'}
        show format
\end{verbatim}

where $<$axes$>$ is either {\bf x}, {\bf y}, {\bf z}, {\bf xy}, {\bf x2}, {\bf y2} or nothing (which is
the same as {\bf xy}).  The length of the string representing a ticmark (after
formatting with printf) is restricted to 100 characters.  If the format
string is omitted, the format will be returned to the default ''\%g''.  For
LaTeX users, the format ''\$\%g\$'' is often desirable.  If the empty string '''' is
used, no label will be plotted with each tic, though the tic mark will still
be plotted.  To eliminate all tic marks, use {\bf set noxtics} or {\bf set noytics}.

The default format for both axes is ''\%g'', but other formats such as ''\%.2f'' or
''\%3.0fm'' are often desirable.  Anything accepted by printf when given a
double precision number, and then accepted by the terminal, will work.  In
particular, the formats f, e, and g will work, and the d, o, x, c, s, and u
formats will not work.  If the data type for the axis is date/time, the
format string must contain valid codes for the strftime function (outside of
{\bf gnuplot}, type {\bf man strftime}).  It is best to stick to the conversion codes
accepted by the {\bf set timefmt} command.  If the format string looks like a
floating point format, then {\bf gnuplot} tries to construct a reasonable format.

For {\bf plot}, newline ($\backslash$n) is accepted in the x-axis format string; for
{\bf splot}, newline is allowed for both x- and y-axis format strings.  Use
double-quotes rather than single-quotes to enable such interpretation.  See
also {\bf syntax}.

See also {\bf set xtics} and {\bf set ytics} for more control over tic labels.
\subsection{Function style}
The {\bf set function style} command changes the default plotting style for
function plots.

Syntax:
\begin{verbatim}
        set function style <style-choice>
        show function style
\end{verbatim}

See {\bf set style} for the choices.  If no choice is given, the choices are
listed.  {\bf show function style} shows the current default function plotting
style.
\subsection{Functions}
The {\bf show functions} command lists all user-defined functions and their
definitions.

Syntax:
\begin{verbatim}
        show functions
\end{verbatim}
\subsection{Grid}
The {\bf set grid} command allows grid lines to be drawn on the graph.

Syntax:
\begin{verbatim}
        set grid {{no}{m}xtics} {{no}{m}ytics} {{no}{m}ztics} \
             {{no}{m}x2tics} {{no}{m}y2tics} \
             {polar {<angle>} {<major-linetype> {<minor-linetype>}}}
        show grid
\end{verbatim}

The grid can be enabled and disabled for the major and/or minor tic marks on
any axis, and the linetype can be specified for major and minor grid lines.
Additionally, a polar grid can be selected for 2-d plots---circles are drawn
to intersect the selected tics, and radial lines are drawn at definable
intervals.  (The interval is given in degrees or radians ,depending on the
{\bf set angles} setting.)  Note that a polar grid is no longer automatically
generated in polar mode.

The pertinent tics must be enabled before {\bf set grid} can draw them; {\bf gnuplot}
will quietly ignore instructions to draw grid lines at non-existent tics, but
they will appear if the tics are subsequently enabled.

If no linetype is specified for the minor gridlines, the same linetype as the
major gridlines is used.  The default polar angle is 30 degrees.

Z grid lines are drawn on the back of the plot.  This looks better if a
partial box is drawn around the plot---see {\bf set border}.
\subsection{Hidden3d}
The {\bf set hidden3d} command enables hidden line removal for explicit surface
plotting (see {\bf splot}).

Syntax:
\begin{verbatim}
        set hidden3d
        set nohidden3d
        show hidden3d
\end{verbatim}

Hidden line removal may be used for both explicit functions and for explicit
data.  It now works for parametric surfaces as well.  This mode is meaningful
only when surfaces are {\bf splot}ted {\bf with lines}.

When this flag is set, both the hidden portion of the surface and possibly
its hidden contours (see {\bf set contour}) as well as the hidden grid will be
removed.  Each surface has its hidden parts removed with respect to itself
and to other surfaces, if more than one surface is plotted.  But contours
drawn on the surface ({\bf set contour surface}) don't seem to work.  Labels and
arrows are always visible and are unaffected.
\subsection{Isosamples}
The isoline density of surfaces may be changed by the {\bf set isosamples}
command.

Syntax:
\begin{verbatim}
        set isosamples <iso_1> {,<iso_2>}
        show isosamples
\end{verbatim}

Each surface plot will have $<$iso\_1$>$ iso-u lines and $<$iso\_2$>$ iso-v lines.  If
you only specify $<$iso\_1$>$, $<$iso\_2$>$ will be set to the same value as $<$iso\_1$>$.
By default, sampling is set to 10 isolines per u or v axis.  A higher
sampling rate will produce more accurate plots, but will take longer.  These
parameters have no effect on data file plotting.

An isoline is a curve parameterized by one of the surface parameters while
the other surface parameter is fixed.  Isolines provide a simple means to
display a surface.  By fixing the u parameter of surface s(u,v), the iso-u
lines of the form c(v) = s(u0,v) are produced, and by fixing the v parameter,
the iso-v lines of the form c(u) = s(u,v0) are produced.

When a surface plot is being done without the removal of hidden lines, {\bf set
samples} also has an effect on the number of points being evaluated---it
controls the number of points sampled along each isoline.  See {\bf set samples}.
\subsection{Key}
The {\bf set key} enables a key describing curves on a plot.

Syntax:
\begin{verbatim}
        set key { <position> | \
                 left | right | top | bottom | outside | below } \
                { Left | Right } \
                { {no}reverse } \
                { title "<text>" } \
                { {no}box {<linetype>} }
        set nokey
        show key
\end{verbatim}

By default the key is placed in the upper right corner of the plot.  The
keywords {\bf left}, {\bf right}, {\bf top}, {\bf bottom}, {\bf outside} and {\bf below} may be used
to place the key in the other corners inside the plot or to the right
(outside) or below the plot.  They may be given alone or combined.

Justification of the labels within the key is controlled by {\bf Left} or {\bf Right}
(default is {\bf Right}).  The text and sample can be reversed ({\bf reverse}) and a
box can be drawn around the key ({\bf box \{$<$linetype$>$\}}) in a specified linetype.
A title can be put on the key ({\bf title ''$<$text$>$''})---see also {\bf syntax} for the
distinction between text in single- or double-quotes.  The title uses the
same justification as do the individual labels.

The $<$position$>$ can be a simple x,y,z as in previous versions, but these can
be preceded by one of four keywords ({\bf first}, {\bf second}, {\bf graph}, {\bf screen})
which selects the co-ordinate system in which the position is specified.  See
{\bf set co-ordinates} for more details.  The key is drawn as a sequence of
lines, with one plot described on each line.  On the right-hand side (or the
left-hand side, if {\bf reverse} is selected) of each line is a representation
that attempts to mimic the way the curve is plotted.  On the other side of
each line is the text description, obtained from the {\bf plot} command.  See
{\bf plot title} to change this description.  The lines are vertically arranged
so that an imaginary straight line divides the left- and right-hand sides of
the key.  It is the co-ordinates of this line that are specified with the
{\bf set key} command.  In a {\bf plot}, only the x and y co-ordinates are used to
specify the line position.  For a {\bf splot}, x, y and z are all used as a 3-d
location mapped using the same mapping as the plot itself to form the
required 2-d screen position of the imaginary line.

Some or all of the key may be outside of the plot boundary, although this may
interfere with other labels and may cause an error on some devices.  If you
use the keywords {\bf outside} or {\bf below}, {\bf gnuplot} makes space for the keys and
the plot becomes smaller.  Putting keys outside to the right, they occupy as
few columns as possible, and putting them below, as many columns as possible
(depending of the length of the labels), thus stealing as little space from
the plot as possible.

When using the TeX or PostScript drivers, or similar drivers where formatting
information is embedded in the string, {\bf gnuplot} is unable to calculate
correctly the width of the string for key positioning.  If the key is to be
positioned at the left, it may be convenient to use the combination  {\bf set key
left Left reverse}.  The box and gap in the grid will be the width of the
literal string.

If {\bf splot} is being used to draw contours, the contour labels will be listed
in the key.  If the alignment of these labels is poor or a different number
of decimal places is desired, the label format can be specified.  See {\bf set
clabel} for details.

Examples:

This places the key at the default location:
\begin{verbatim}
        set key
\end{verbatim}
This disables the key:
\begin{verbatim}
        set nokey
\end{verbatim}
This places a key at co-ordinates 2,3.5,2:
\begin{verbatim}
        set key 2,3.5,2
\end{verbatim}
This places the key below the plot:
\begin{verbatim}
        set key below
\end{verbatim}
This places the key in the bottom left corner, left-justifies the text,
gives it a title, and draws a box around it in linetype 3:
\begin{verbatim}
        set key left bottom Left title 'Legend' box 3
\end{verbatim}
\subsection{Label}
Arbitrary labels can be placed on the plot using the {\bf set label} command.

Syntax:
\begin{verbatim}
         set label {<tag>} {"<label_text>"} {at <position>}
                           {<justification>} {font "<name><,size>"}
         set nolabel {<tag>}
         show label
\end{verbatim}

The $<$position$>$ is specified by either x,y or x,y,z, and may be preceded by
{\bf first}, {\bf second}, {\bf graph}, or {\bf screen} to select the co-ordinate system.
See {\bf set co-ordinates} for details.

The text is scanned for backslash-octal ($\backslash$nnn) conversion.  It defaults to
the null text ''''.

The tag is an integer that is used to identify the label. If no $<$tag$>$ is
given, the lowest unused tag value is assigned automatically.  The tag can be
used to delete or modify a specific label.  To change any attribute of an
existing label, use the {\bf set label} command with the appropriate tag, and
specify the parts of the label to be changed.

By default, the text is placed flush left against the point x,y,z.  To adjust
the way the label is positioned with respect to the point x,y,z, add the
parameter $<$justification$>$, which may be {\bf left}, {\bf right} or {\bf center},
indicating that the point is to be at the left, right or center of the text.
Labels outside the plotted boundaries are permitted but may interfere with
axis labels or other text.

If one (or more) axis is timeseries, the appropriate co-ordinate should be
given as a quoted time string according to the {\bf timefmt} format string.  See
{\bf set \{x,y,z\}data} and {\bf set timefmt}.

The EEPIC, Imagen, LaTeX, and TPIC drivers allow $\backslash$$\backslash$ in a string to specify
a newline.

Examples:

To set a label at (1,2) to ``y=x'', use:
\begin{verbatim}
         set label "y=x" at 1,2
\end{verbatim}
To set a label of the sign Sigma of size 24 at center of plot area, use:
\begin{verbatim}
         set label "S" at graph 1,2 font "Symbol,24"
\end{verbatim}
To set a label ``y=x\verb+^+2'' with the right of the text at (2,3,4), and tag the
label as number 3, use:
\begin{verbatim}
         set label 3 "y=x^2" at 2,3,4 right
\end{verbatim}
To change the preceding label to center justification, use:
\begin{verbatim}
         set label 3 center
\end{verbatim}
To delete label number 2, use:
\begin{verbatim}
         set nolabel 2
\end{verbatim}
To delete all labels, use:
\begin{verbatim}
         set nolabel
\end{verbatim}
To show all labels (in tag order), use:
\begin{verbatim}
         show label
\end{verbatim}
To set a label on a plot with a timeseries (timefmt=''\%d/\%m/\%y,\%H:\%M) on the
x axis, use something like:
\begin{verbatim}
         set label "Harvest" at "25/8/93",1
\end{verbatim}
\subsection{Lmargin}
The command {\bf set lmargin} sets the size of the left margin.  Please see
{\bf set margins} for details.
\subsection{Logscale}
Log scaling may be set on the x, y, z, x2 and/or y2 axes.

Syntax:
\begin{verbatim}
        set logscale <axes> <base>
        set nologscale <axes>
        show logscale
\end{verbatim}

where $<$axes$>$ may be any combinations of {\bf x}, {\bf y}, and {\bf z}, in any order, or
{\bf x2} or {\bf y2} and where $<$base$>$ is the base of the log scaling.  If $<$base$>$ is
not given, then 10 is assumed.  If $<$axes$>$ is not given, then all axes are
assumed.  {\bf set nologscale} turns off log scaling for the specified axes.

Examples:

To enable log scaling in both x and z axes:
\begin{verbatim}
       set logscale xz
\end{verbatim}
To enable scaling log base 2 of the y axis:
\begin{verbatim}
       set logscale y 2
\end{verbatim}
To disable z axis log scaling:
\begin{verbatim}
       set nologscale z
\end{verbatim}
\subsection{Missing}
The {\bf set missing} command allows you to tell {\bf gnuplot} what character is
used in a data file to denote missing data.

Syntax:
\begin{verbatim}
        set missing {"character"}
\end{verbatim}

Example:
\begin{verbatim}
        set missing "?"
\end{verbatim}

would mean that, when plotting a file containing

\begin{verbatim}
        1 1
        2 ?
        3 2
\end{verbatim}

the middle line would be ignored.

There is no default character for {\bf missing}.
\subsection{Mx2tics}
Minor tic marks along the x2 axis are controlled by {\bf set mx2tics}.  Please
see {\bf set mxtics}.
\subsection{My2tics}
Minor tic marks along the y2 axis are controlled by {\bf set my2tics}.  Please
see {\bf set mxtics}.
\subsection{Mapping}
If data are provided to {\bf splot} in spherical or cylindrical co-ordinates,
the {\bf set mapping} command should be used to instruct {\bf gnuplot} how to
interpret them.

Syntax:
\begin{verbatim}
        set mapping { cartesian | spherical | cylindrical }
\end{verbatim}

For a spherical co-ordinate system, the data occupy two or three columns.
The first two are interpreted as the polar and azimuthal angles theta and phi
(in the units specified by {\bf set angles}).  The radius r is taken from the
third column if there is one, or is set to unity if there is no third column.
The mapping is:

\begin{verbatim}
        x = r * cos( theta ) * cos( phi )
        y = r * sin( theta ) * cos( phi )
        z = r * sin( phi )
\end{verbatim}

For a cylindrical co-ordinate system, the data again occupy two or three
columns.  The first two are interpreted as theta (in the units specified by
{\bf set angles}) and z.  The radius is either taken from the third column or set
to unity, as in the spherical case.  The mapping is:

\begin{verbatim}
        x = r * cos( theta )
        y = r * sin( theta )
        z = z
\end{verbatim}

The effects of {\bf mapping} can be duplicated with the {\bf using} filter on the
{\bf splot} command, but {\bf mapping} may be more convenient if many data files are
to be processed.

{\bf mapping} has no affect on data file {\bf plot}s.
\subsection{Margin}
Normally the margins of the plot are automatically calculated based on tics
and axis labels.  These computed values can be overridden by the {\bf set margin}
commands.  {\bf show margin} shows the current settings.

Syntax:
\begin{verbatim}
        set bmargin {<margin>}
        set lmargin {<margin>}
        set rmargin {<margin>}
        set tmargin {<margin>}
        show margin
\end{verbatim}

The units of $<$margin$>$ are character heights or widths, as appropriate.  A
positive value always adds to the size of the margin.  Omitting it causes
{\bf gnuplot} to revert to the computed values.
\subsection{Multiplot}
The command {\bf set multiplot} places {\bf gnuplot} in the multiplot mode, in which
several plots are placed on the same page, window, or screen.

Syntax:
\begin{verbatim}
        set multiplot
        set nomultiplot
\end{verbatim}

For some terminals, no plot is displayed until the command {\bf set nomultiplot}
is given, which causes the entire page to be drawn and then returns {\bf gnuplot}
to its normal single-plot mode.  For other terminals, each separate {\bf plot}
command produces a plot.

The commands {\bf set origin} and {\bf set size} must be used to correctly position
each plot; see {\bf set origin} and {\bf set size} for details of their usage.

Example:
\begin{verbatim}
        set size 0.7,0.7
        set origin 0.1,0.1
        set multiplot
        set size 0.4,0.4
        set origin 0.1,0.1
        plot sin(x)
        set size 0.2,0.2
        set origin 0.5,0.5
        plot cos(x)
        set nomultiplot
\end{verbatim}

displays a plot of cos(x) stacked above a plot of sin(x).  Note the initial
{\bf set size} and {\bf set origin}.  While these are not always required, their
inclusion is recommended.  Some terminal drivers require that bounding box
information be available before any plots can be made, and the form given
above guarantees that the bounding box will include the entire plot array
rather than just the bounding box of the first plot.
\subsection{Mxtics}
Minor tic marks along the x axis are controlled by {\bf set mx2tics}.  They can
be turned off with {\bf set nomxtics}.  Similar commands control minor tics along
the other axes.

Syntax:
\begin{verbatim}
        set mxtics {<freq>}
        set mytics {<freq>}
        set mztics {<freq>}
        set mx2tics {<freq>}
        set my2tics {<freq>}
        set nomxtics
        etc.
        show mxtics
        etc.
\end{verbatim}

$<$freq$>$ is the number of sub-intervals (NOT the number of minor tics!) between
major tics (ten is the default, so there are nine minor tics between major
tics).

If the axis is logarithmic, the number of sub-intervals will be set to a
reasonable number by default (based upon the length of a decade).  This will
be overridden if $<$freq$>$ is given.  However the usual minor tics (2, 3, ...,
8, 9 between 1 and 10, for example) are obtained by setting $<$freq$>$ to 10,
even though there are but nine sub-intervals.

By default, minor tics are off for linear axes and on for logarithmic axes.
They inherit the settings for {\bf axis$|$border} and {\bf \{no\}mirror} specified for
the major tics.  Please see {\bf set xtics} for information about these.
\subsection{Mytics}
Minor tic marks along the y axis are controlled by {\bf set mytics}.  Please
see {\bf set mxtics}.
\subsection{Mztics}
Minor tic marks along the z axis are controlled by {\bf set mztics}.  Please
see {\bf set mxtics}.
\subsection{Offsets}
Offsets provide a mechanism to put a boundary around the data inside of an
autoscaled plot.

Syntax:
\begin{verbatim}
        set offsets <left>, <right>, <top>, <bottom>
        set nooffsets
        show offsets
\end{verbatim}

Each offset may be a constant or an expression.  Each defaults to 0.  Left
and right offsets are given in units of the x axis, top and bottom offsets in
units of the y axis.  A positive offset expands the plot in the specified
direction, e.g., a positive bottom offset makes ymin more negative.  Negative
offsets, while permitted, can have unexpected interactions with autoscaling
and clipping.

Offsets are ignored in {\bf splot}s.

Example:
\begin{verbatim}
        set offsets 0, 0, 2, 2
        plot sin(x)
\end{verbatim}

This plot of sin(x) will have a y range [-3:3] because the function
will be autoscaled to [-1:1] and the vertical offsets are each two.
\subsection{Origin}
The {\bf set origin} command is used to specify the origin of a plotting surface
(i.e., the graph and its margins) on the screen.  The co-ordinates are given
in the {\bf screen} co-ordinate system (see {\bf co-ordinates} for information about
this system).

Syntax:
\begin{verbatim}
        set origin <x-origin>,<y-origin>
\end{verbatim}
\subsection{Output}
By default, plots are displayed to the standard output. The {\bf set output}
command redirects the display to the specified file or device.

Syntax:
\begin{verbatim}
        set output {"<filename>"}
        show output
\end{verbatim}

The filename must be enclosed in quotes.  If the filename is omitted, any
output file opened by a previous invocation of {\bf set output} will be closed
and new output will be sent to the standard output.  MSDOS users should note
that the $\backslash$ character has special significance in double-quoted strings, so
single-quotes should be used for filenames in different directories.

On machines with popen functions (Unix), output can be piped through a shell
command if the first character of the filename is '$|$'.  For instance,

\begin{verbatim}
        set output "|lpr -Plaser filename"
        set output "|lp -dlaser filename"
\end{verbatim}

On MSDOS machines, {\bf set output ``PRN''} will direct the output to the default
printer.  On VMS, output can be sent directly to any spooled device.  It is
also possible to send the output to DECnet transparent tasks, which allows
some flexibility.
\subsection{Parametric}
The {\bf set parametric} command changes the meaning of {\bf plot} ({\bf splot}) from
normal functions to parametric functions.  The command {\bf set noparametric}
restores the plotting style to normal, single-valued expression plotting.

Syntax:
\begin{verbatim}
        set parametric
        set noparametric
        show parametric
\end{verbatim}

For 2-d plotting, a parametric function is determined by a pair of parametric
functions operating on a parameter.  An example of a 2-d parametric function
would be {\bf plot sin(t),cos(t)}, which draws a circle (if the aspect ratio is
set correctly---see {\bf set size}).  {\bf gnuplot} will display an error message if
both functions are not provided for a parametric {\bf plot}.

For 3-d plotting, the surface is described as x=f(u,v), y=g(u,v), z=h(u,v).
Therefore a triplet of functions is required.  An example of a 3-d parametric
function would be {\bf cos(u)*cos(v),cos(u)*sin(v),sin(u)}, which draws a sphere.
{\bf gnuplot} will display an error message if all three functions are not
provided for a parametric {\bf splot}.

The total set of possible plots is a superset of the simple f(x) style plots,
since the two functions can describe the x and y values to be computed
separately.  In fact, plots of the type t,f(t) are equivalent to those
produced with f(x) because the x values are computed using the identity
function.  Similarly, 3-d plots of the type u,v,f(u,v) are equivalent to
f(x,y).

Note that the order the parametric functions are specified is xfunction,
yfunction (and zfunction) and that each operates over the common parametric
domain.

Also, the {\bf set parametric} function implies a new range of values.  Whereas
the normal f(x) and f(x,y) style plotting assume an xrange and yrange (and
zrange), the parametric mode additionally specifies a trange, urange, and
vrange.  These ranges may be set directly with {\bf set trange}, {\bf set urange},
and {\bf set vrange}, or by specifying the range on the {\bf plot} or {\bf splot}
commands.  Currently the default range for these parametric variables is
[-5:5].  Setting the ranges to something more meaningful is expected.
\subsection{Pointsize}
The {\bf set pointsize} command changes the size of the points used in plots.

Syntax:
\begin{verbatim}
        set pointsize <pointsize>
        show pointsize
\end{verbatim}

Default is pointsize 1.0.  Larger pointsizes ($>$1.0) are useful for high
resolution in bitmapped graphics.

Please note that the pointsize setting is not supported with all terminal
types.
\subsection{Polar}
The {\bf set polar} command changes the meaning of the plot from rectangular
co-ordinates to polar co-ordinates.

Syntax:
\begin{verbatim}
        set polar
        set nopolar
        show polar
\end{verbatim}

There have been changes made to polar mode in version 3.6, so that scripts
for {\bf gnuplot} versions 3.5 and earlier will require modification.  The main
change is that the dummy variable t is used for the angle so that the x and
y ranges can be controlled independently.  Other changes are:
1) tics are no longer put along the zero axes automatically
---use {\bf set [x$|$y]tics axis nomirror};
2) the grid, if selected, is not automatically polar
---use {\bf set grid polar};
3) the grid is not labelled with angles
---use {\bf set label} as necessary.

In polar co-ordinates, the dummy variable (t) is an angle.  The default range
of t is [0:2*pi], or, if degree units have been selected, to [0:360] (see
{\bf set angles}).

The command {\bf set nopolar} changes the meaning of the plot back to the default
rectangular co-ordinate system.

The {\bf set polar} command is not supported for {\bf splot}s.  See the {\bf set mapping}
command for similar functionality for {\bf splot}s.

While in polar co-ordinates the meaning of an expression in t is really
r = f(t), where t is an angle of rotation.  The trange controls the domain
(the angle) of the function, and the x and y ranges control the range of the
plot in the x and y directions.

Example:
\begin{verbatim}
        set polar
        plot t*sin(t)
        plot [-2*pi:2*pi] [-3:3] [-3:3] t*sin(t)
\end{verbatim}

The first {\bf plot} uses the default polar angular domain of 0 to 2*pi.  The
radius and the size of the plot are scaled automatically.  The second {\bf plot}
expands the domain, and restricts the size of the plot to [-3:3] in both
directions.

You may want to {\bf set size square} to have {\bf gnuplot} try to make the aspect
ratio equal to unity, so that circles look circular.
\subsection{Range}
The {\bf set xrange} command sets the horizontal range that will be displayed.
A similar command exists for each of the other axes, as well as for the
polar radius r and the parametric variables t, u, and v.

Syntax:
\begin{verbatim}
        set xrange [{<min> : <max>}] {{no}reverse} {{no}writeback}
        set xrange [{<min> : <max>}] {{no}reverse} {{no}writeback}
        set zrange [{<min> : <max>}] {{no}reverse} {{no}writeback}
        set x2range [{<min> : <max>}] {{no}reverse} {{no}writeback}
        set y2range [{<min> : <max>}] {{no}reverse} {{no}writeback}
        set rrange [{<min> : <max>}] {{no}reverse} {{no}writeback}
        set trange [{<min> : <max>}] {{no}reverse} {{no}writeback}
        set urange [{<min> : <max>}] {{no}reverse} {{no}writeback}
        set vrange [{<min> : <max>}] {{no}reverse} {{no}writeback}
\end{verbatim}

where $<$min$>$ and $<$max$>$ terms are constants or expressions or a star to set
autoscaling.  If the data are date/time, you must give the range as a quoted
string according to the {\bf set timefmt} format.  Both the $<$min$>$ and $<$max$>$
terms are optional.  Any value omitted will not be changed.

The {\bf reverse} option reverses the direction of the axis, e.g., {\bf set xrange
[0:1] reverse} will produce an axis with 1 on the left and 0 on the right.
This is identical to the axis produced by {\bf set xrange [1:0]}, of course.
{\bf reverse} is intended primarily for use with {\bf autoscale}.

The {\bf writeback} option essentially saves the range found by {\bf autoscale} in
the min/max buffers that would be filled by {\bf set range}.  This is useful if
you wish to plot several functions together but have the range determined by
only some of them.  The {\bf writeback} operation is performed during the {\bf plot}
execution, so it must be specified before that command.  For example,

\begin{verbatim}
        set xrange [-10:10]
        set yrange [] writeback
        plot sin(x)
        set noautoscale y
        replot x/2
\end{verbatim}

results in a yrange of [-1:1] as found only from the range of sin(x); the
[-5:5] range of x/2 is ignored.  Executing {\bf show yrange} after each command
in the above example should help you understand what is going on.

In 2-d, {\bf xrange} and {\bf yrange} determine the extent of the axes, {\bf trange}
determines the range of the parametric variable in parametric mode or the
range of the angle in polar mode.  Similarly in parametric 3-d, {\bf xrange},
{\bf yrange}, and {\bf zrange} govern the axes and {\bf urange} and {\bf vrange} govern the
parametric variables.  In polar mode,{\bf rrange} determines the radial range
plotted.  $<$rmin$>$ acts as an additive constant to the radius, whereas $<$rmax$>$
acts as a clip to the radius---no point with radius greater than $<$rmax$>$ will
be plotted.

Any range may be partially or totally autoscaled, although it may not make
sense to autoscale a parametric variable unless it is plotted with data.

Ranges may also be specified on the {\bf plot} command line.  A range given on
the plot line will be used for that single {\bf plot} command; a range given by
a {\bf set} command will be used for all subsequent plots that do not specify
their own ranges.  The same holds true for {\bf splot}.

Examples:
To set the xrange to the default:
\begin{verbatim}
        set xrange [-10:10]
\end{verbatim}
To set the yrange to increase downwards:
\begin{verbatim}
        set yrange [10:-10]
\end{verbatim}
To change zmax to 10 without affecting zmin (which may still be autoscaled):
\begin{verbatim}
        set zrange [:10]
\end{verbatim}
To autoscale xmin while leaving xmax unchanged:
\begin{verbatim}
        set xrange [*:]
\end{verbatim}
\subsection{Rmargin}
The command {\bf set rmargin} sets the size of the right margin.  Please see
{\bf set margins} for details.
\subsection{Rrange}
For a polar plot, the radial co-ordinate should be non-negative, but {\bf rrange}
can be used to move the singularity.

Syntax:
\begin{verbatim}
        set rrange {[<rmin>:<rmax>]}
        show rrange
\end{verbatim}

{\bf rmin} specifies the radius at the origin and {\bf rmax} provides clipping for
large radii.  {\bf xrange} and {\bf yrange} are affected---the ranges can be set as
if the plot was of r(t)-rmin, with rmin added to all the labels.  ({\bf set term
table} reveals that it is in fact implemented that way.)
\subsection{Samples}
The sampling rate of functions may be changed by the {\bf set samples} command.

Syntax:
\begin{verbatim}
        set samples <samples_1> {,<samples_2>}
        show samples
\end{verbatim}

By default, sampling is set to 100 points.  A higher sampling rate will
produce more accurate plots, but will take longer.  This parameter no longer
has any effect on data-file plotting.

When a 2-d plot is being done, only the value of $<$samples\_1$>$ is relevant.

When a surface plot is being done without the removal of hidden lines, the
value of samples specifies the number of samples that are to be evaluated for
isoline.  Each iso-v line will have $<$sample\_1$>$ samples and each iso-u line
will have $<$sample\_2$>$ samples.  If you only specify $<$samples\_1$>$, $<$samples\_2$>$
will be set to the same value as $<$samples\_1$>$.  See also {\bf set isosamples}.
\subsection{Size}
The {\bf set size} command scales the displayed size of the plot.

Syntax:
\begin{verbatim}
        set size {{no}square} {<xscale>,<yscale>}
        show size
\end{verbatim}

The $<$xscale$>$ and $<$yscale$>$ values are the scaling factors for the size.  The
defaults (1,1) are selected if the scaling factors are omitted.  If {\bf square}
is specified, {\bf gnuplot} will attempt to make the plot area square, to give
polar plots the correct aspect ratio, for example.  Success depends on the
terminal driver selected.  The plot area will be the largest square that will
fit into the specified portion of the output.

Note that the size of the plot includes the space used by the labels; the
plotting area itself is smaller.  {\bf square} takes only the plotting area into
account.

If {\bf set key out} is specified, the key is drawn at the far right edge of the
usable area---you can use something like
\begin{verbatim}
   `set size square 0.9,1`
\end{verbatim}
to bring it closer to the square plotting area.

On some terminals, changing the size of the plot will result in text being
misplaced.  Increasing the size of the plot may produce strange results.
Decreasing is safer.

Examples:

To set the size to normal size use:
\begin{verbatim}
        set size 1,1
\end{verbatim}
To make the plot half size and square use:
\begin{verbatim}
        set size square 0.5,0.5
\end{verbatim}
To show the size use:
\begin{verbatim}
        show size
\end{verbatim}

For the LaTeX and Fig terminals the default size (scale factor 1,1) is 5
inches wide by 3 inches high.  The big Fig terminal ({\bf bfig}) is 7 inches wide
by 5 inches high.  The PostScript default is landscape mode 10 inches wide
and 7 inches high; portrait mode has these dimensions reversed, and EPS cuts
them in half.
\subsection{Style}
Default styles are chosen with the {\bf set function style} and {\bf set data style}
commands.  See {\bf plot style} for information about how to override the default
plotting style for individual functions and data sets.

Syntax:
\begin{verbatim}
        set function style <style>
        set data style <style>
        show function style
        show data style
\end{verbatim}

The types used for all line and point styles (i.e., solid, dash-dot, color,
etc. for lines; circles, squares, crosses, etc. for points) will be either
those specified on the {\bf plot} or {\bf splot} command or will be chosen
sequentially from the types available to the terminal in use.  Use the
command {\bf test} to see what is available.

None of the {\bf errorbars} styles can be used with {\bf splot}s or function {\bf plot}s.
If one is specified, it will be changed to {\bf points}.

For 2-d data with more than two columns, {\bf gnuplot} is picky about the allowed
{\bf errorbar} styles:

For three columns, only {\bf xerrorbars}, {\bf yerrorbars} (or {\bf errorbars}), {\bf boxes},
and {\bf boxerrorbars} are allowed.  If another plot style is used, the style
will be changed to {\bf yerrorbars}.  The {\bf boxerrorbars} style will calculate the
boxwidth automatically.

For four columns, only {\bf xerrorbars}, {\bf yerrorbars} (or {\bf errorbars}),
{\bf xyerrorbars}, {\bf boxxyerrorbars}, and {\bf boxerrorbars}, are allowed.  An illegal
plot style will be changed to {\bf yerrorbars}.

Five-column data allow only the {\bf boxerrorbars} style.  An illegal style will
be changed to {\bf boxerrorbars} before plotting.

Six- and seven-column data only allow the {\bf xyerrorbars} and {\bf boxxyerrorbars}
styles.  Illegal styles will be changed to {\bf xyerrorbars} before plotting.

Use the {\bf using} option on the {\bf plot} command to set up the correct number of
columns for the style you want.
\subsubsection{Bezier}
The {\bf bezier} style connects adjacent points with Bezier curves.
\subsubsection{Boxerrorbars}
The {\bf boxerrorbars} style is only relevant to 2-d data plotting.  It is a
combination of the {\bf boxes} and {\bf yerrorbars} styles.  The boxwidth will come
from the fourth column if the y errors are in the form of ``ydelta'' and the
boxwidth was not previously set equal to -2.0 ({\bf set boxwidth -2.0}) or from
the fifth column if the y errors are in the form of ``ylow yhigh''.  The
special case  {\bf boxwidth = -2.0} is for four-column data with y errors in the
form ``ylow yhigh''.  In this case the boxwidth will be calculated so that each
box touches the adjacent boxes.  The width will also be calculated in cases
where three-column data are used.

The box height is determined from the y error in the same way as it is for
the {\bf yerrorbars} style---either from y-ydelta to y+ydelta or from ylow to
yhigh, depending on how many data columns are provided.
\subsubsection{Boxes}
The {\bf boxes} style is only relevant to 2-d plotting.  It draws a box centered
about the given x co-ordinate from the x axis (not the plot border) to the
given y co-ordinate.  The width of the box is obtained in one of three ways.
If it is a data plot and the data file has a third column, this will be used
to set the width of the box.  If not, if a width has been set using the {\bf set
boxwidth} command, this will be used.  If neither of these is available, the
width of each box will be calculated automatically so that it touches the
adjacent boxes.
\subsubsection{Boxxyerrorbars}
The {\bf boxxyerrorbars} style is only relevant to 2-d data plotting.  It is a
combination of the {\bf boxes} and {\bf xyerrorbars} styles.

The box width and height are determined from the x and y errors in the same
way as they are for the {\bf xyerrorbars} style---either from xlow to xhigh and
from ylow to yhigh, or from x-xdelta to x+xdelta and from y-ydelta to
y+ydelta , depending on how many data columns are provided.
\subsubsection{Csplines}
The {\bf csplines} style connects adjacent points with cubic splines.
\subsubsection{Dots}
The {\bf dots} style plots a tiny dot at each point; this is useful for scatter
plots with many points.
\subsubsection{Fsteps}
The {\bf fsteps} style is only relevant to 2-d plotting.  It connects consecutive
points with two line segments: the first from (x1,y1) to (x1,y2) and the
second from (x1,y2) to (x2,y2).
\subsubsection{Impulses}
The {\bf impulses} style displays a vertical line from the x axis (not the plot
border), or from the grid base for {\bf splot}, to each point.
\subsubsection{Lines}
The {\bf lines} style connects adjacent points with straight line segments.
\subsubsection{Linespoints}
The {\bf linespoints} style does both {\bf lines} and {\bf points}, that is, it draws a
small symbol at each point and then connects adjacent points with straight
line segments.  The command {\bf set pointsize} may be used to change the size of
the points.  See {\bf set pointsize} for its usage.
\subsubsection{Points}
The {\bf points} style displays a small symbol at each point.  The command {\bf set
pointsize} may be used to change the size of the points.  See {\bf set pointsize}
for its usage.
\subsubsection{Sbezier}
The {\bf sbezier} style connects adjacent points with Bezier curves different in
some way from those used by the {\bf bezier} style.
\subsubsection{Splines}
The {\bf splines} style connects adjacent points with quadratic splines.
\subsubsection{Steps}
The {\bf steps} style is only relevant to 2-d plotting.  It connects consecutive
points with two line segments: the first from (x1,y1) to (x2,y1) and the
second from (x2,y1) to (x2,y2).
\subsubsection{Vectors}
The {\bf vectors} style draws a vector from (x,y) to (x+xdelta,y+ydelta).  Thus
it requires four columns of data.  It also draws a small arrowhead at the
end of the vector.

The {\bf vectors} style is still experimental: it doesn't get clipped properly
and other things may also be wrong with it.  Use it at your own risk.
\subsubsection{Xerrorbars}
The {\bf xerrorbars} style is only relevant to 2-d data plots.  {\bf xerrorbars} is
like {\bf dots}, except that a horizontal error bar is also drawn.  At each point
(x,y), a line is drawn from (xlow,y) to (xhigh,y) or from (x-xdelta,y) to
(x+xdelta,y), depending on how many data columns are provided.  A tic mark
is placed at the ends of the error bar (unless {\bf set bar small} is used).
\subsubsection{Xyerrorbars}
The {\bf xyerrorbars} style is only relevant to 2-d data plots.  {\bf xyerrorbars} is
like {\bf dots}, except that horizontal and vertical error bars are also drawn.
At each point (x,y), lines are drawn from (x,y-ydelta) to (x,y+ydelta) and
from (x-xdelta,y) to (x+xdelta,y) or from (x,ylow) to (x,yhigh) and from
(xlow,y) to (xhigh,y), depending upon the number of data columns provided.  A
tic mark is placed at the ends of the error bar (unless {\bf set bar small} is
used).

If data are provided in an unsupported mixed form, the {\bf using} filter on the
{\bf plot} command should be used to set up the appropriate form.  For example,
if the data are of the form (x,y,xdelta,ylow,yhigh), then you can use

\begin{verbatim}
       plot 'data' using 1:2:($1-$3),($1+$3),4,5 with xyerrorbars
\end{verbatim}
\subsubsection{Yerrorbars}
The {\bf yerrorbars} (or {\bf errorbars}) style is only relevant to 2-d data plots.
{\bf yerrorbars} is like {\bf dots}, except that a vertical error bar is also drawn.
At each point (x,y), a line is drawn from (x,y-ydelta) to (x,y+ydelta) or
from (x,ylow) to (x,yhigh), depending on how many data columns are provided.
A tic mark is placed at the ends of the error bar (unless {\bf set bar small} is
used).
\subsection{Surface}
The command {\bf set surface} controls the display of surfaces, which are drawn
as a mesh of isolines.

Syntax:
\begin{verbatim}
        set surface
        set nosurface
        show surface
\end{verbatim}

Whenever {\bf set nosurface} is issued, no surface isolines/mesh will be drawn.
This is useful if contours are to be displayed by themselves.  See also {\bf set
contour}.
\subsection{Terminal}
{\bf gnuplot} supports many different graphics devices.  Use the {\bf set terminal}
command to select the type of device for which {\bf gnuplot} will produce output.

Syntax:
\begin{verbatim}
        set terminal {<terminal-type>}
        show terminal
\end{verbatim}

If $<$terminal-type$>$ is omitted, {\bf gnuplot} will list the available terminal
types.  $<$terminal-type$>$ may be abbreviated.

Use {\bf set output} to redirect this output to a file or device.

Several terminals have additional options.  For example, see {\bf dumb},
{\bf iris4d}, {\bf hpljii} or {\bf postscript}.
\subsection{- paste here the help from the .trm files, at level 4 onwards}
\subsubsection{Atari ST (via AES)}
The {\bf atari} terminal has options to set the character size and the screen
colors.  The driver expects a space-separated list containing the character
size and up to 16 three-digit hex numbers, where each digit represents RED,
GREEN and BLUE (in that order).  The range of 0--15 is scaled to whatever
color range the screen actually has.  On a normal ST screen, odd and even
intensities are the same.

Examples:

\begin{verbatim}
       set terminal atari 4 # (use small (6x6) font)
       set terminal atari 6 0 # (set monochrome screen to white on black)
       set terminal atari 13 0 fff f00 f0 f ff f0f ff0
       # (set first eight colors to black, white, green, blue, cyan, \
         purple, and yellow and use large font (8x16).)
\end{verbatim}

Additionally, if an environment variable GNUCOLORS exists, its contents are
interpreted as an options string, but an explicit terminal option takes
precedence.
\subsubsection{Atari ST (via VDI)}
This terminal is the same as the {\bf atari} terminal, except for the fact that
it sends output to the screen via the VDI and not into AES-Windows.)

The {\bf vdi} terminal has the same options as the {\bf atari} terminal.

\subsubsection{Atari ST (for Multitasking Systems)}
The {\bf mtos} terminal has no options.  It sends data via a pipe to an external
program called GPCLIENT.  It runs under MiNT, MULTITOS and Magic 3.x.
\subsubsection{Epson}
This set of drivers support Epson printers and derivatives.  {\bf epson} is a
generic 9-wire printer with a resolution of 512x384.  {\bf starc} is a Star Color
printer with the same resolution.  {\bf epson180} and {\bf epson60} are 180-dpi and
60-dpi drivers for newer 24-wire printers.  This also includes bubble jet
printers.  Their resolutions are 1260x1080 and 480x360, respectively.  The
{\bf tandy60} is identical to the {\bf epson60} driver with one additional escape
sequence to start IBM mode.

With all of these drivers, a binary copy is required on a PC to print.  Do
not use {\bf print}:

\begin{verbatim}
       copy file /b lpt1:
\end{verbatim}
\subsubsection{Gpic}
This driver is only known to work with the Free Software Foundation
gpic/groff package.  Modification for the Document Workbench pic/troff
package would be appreciated.  FSF gpic can also produce TeX output.

A simple graph can be formatted using

\begin{verbatim}
     groff -p -mpic -Tps file.pic > file.ps.
\end{verbatim}

The output from pic can be pipe-lined into eqn, so it is possible to put
complex functions in a graph with the set label and set \{x/y\}label commands.
For instance,

\begin{verbatim}
   set ylab '@space 0 int from 0 to x alpha ( t ) roman d t@'
\end{verbatim}

will label the y axis with a nice integral if formatted with the command:

\begin{verbatim}
   gpic filename.pic | geqn -d@@ -Tps | groff -m[macro-package] -Tps
        > filename.ps
\end{verbatim}

Figures made this way can be scaled to fit into a document.  The pic language
is easy to understand, so the graphs can be edited by hand if need be.  All
co-ordinates in the pic-file produced by {\bf gnuplot} are given as x+gnuplotx
and y+gnuploty.  By default x and y are given the value 0.  If this line is
removed with an editor in a number of files, one can put several graphs in
one figure like this (default size is 5.0x3.0 inches):

\begin{verbatim}
   .PS 8.0
   x=0;y=3
   copy "figa.pic"
   x=5;y=3
   copy "figb.pic"
   x=0;y=0
   copy "figc.pic"
   x=5;y=0
   copy "figd.pic"
   .PE
\end{verbatim}

This will produce an 8-inch-wide figure with four graphs in two rows on top
of each other.

One can also achieve the same thing by the command

\begin{verbatim}
  set term pic x y
\end{verbatim}

For example, using

\begin{verbatim}
  .PS 6.0
  copy "trig.pic"
  .PE
\end{verbatim}
\subsubsection{Hpljii}
The HP LaserJet II and HP DeskJet drivers have a single option.

Syntax:
\begin{verbatim}
        set terminal hpljii {<resolution>}
        set terminal hpdj   {<resolution>}
\end{verbatim}

where $<$resolution$>$ is the resolution of the output in dots per inch.  It must
be {\bf 75}, {\bf 100}, {\bf 150} or {\bf 300}.  Note: there must be enough memory available
to rasterize at the higher resolutions.

Example:
\begin{verbatim}
        set terminal hpljii 150
\end{verbatim}
\subsubsection{Imagen}
The imagen driver is able to draw several plots on each page (in either
portrait or landscape orientation), and fontsize may also be specified.

Options are:
\begin{verbatim}
      portrait
      landscape        (default)
      [ x , y ]        (where x and y are the number of plots in the x and y
                        directions on the page)
      n                (where n is fontsize in points)
\end{verbatim}

To plot 6 plots per page in two columns in portrait orientation:
\begin{verbatim}
      set term imagen po [2,3]
\end{verbatim}

\subsubsection{Iris4d}
The iris4d driver can operate in two modes.

Syntax:
\begin{verbatim}
        set terminal iris4d {24}
\end{verbatim}

If the hardware supports only 8 bits, use the default {\bf set terminal iris4d}.
If, however, the hardware supports 24 bits (8 per red/green/blue), use {\bf set
terminal iris4d 24}.

When using 24-bit mode, the colors can be directly specified via the file
.gnuplot\_iris4d that is searched in the current directory and then in the
home directory specified by the HOME environment variable.  This file holds
RGB values for the background, border, labels and nine plotting colors, in
that order.  For example, here is a file containing the default colors:

\begin{verbatim}
        85   85   85     /* Background */
        0    0    0      /* Boundary */
        170  0    170    /* Labeling */
        85   255  255    /* Plot Color 1 */
        170  0    0      /* Plot Color 2 */
        0    170  0      /* Plot Color 3 */
        255  85   255    /* Plot Color 4 */
        255  255  85     /* Plot Color 5 */
        255  85   85     /* Plot Color 6 */
        85   255  85     /* Plot Color 7 */
        0    170  170    /* Plot Color 8 */
        170  170  0      /* Plot Color 9 */
\end{verbatim}

This file has exactly 12 lines of RGB triples.  No empty lines are allowed
and anything after the third number in line is ignored.
\subsubsection{Nec-cp6}
One option may be set in the nec-cp6 driver.  The resolution of this driver
is 400x320.

Syntax:
\begin{verbatim}
        set terminal nec-cp6 monochrome
        set terminal nec-cp6 color
        set terminal nec-cp6 draft
\end{verbatim}
\subsubsection{Pcl5}
Three options may be set in the pcl5 driver.  The driver actually uses HPGL-2
but there is a name conflict among the terminal devices.

Syntax:
\begin{verbatim}
        set terminal pcl5 {<mode>} {<font>} {<fontsize>}
\end{verbatim}

where $<$mode$>$ is {\bf landscape}, or {\bf portrait}, $<$font$>$ is {\bf stick}, {\bf univers}, or
{\bf cg\_times}, and fontsize is the size in points.

Example:
\begin{verbatim}
        set terminal pcl5 landscape
\end{verbatim}

\subsubsection{Tgif}
The Tgif driver supports different pointsizes (with {\bf set pointsize}),
different label fonts and font sizes (e.g. {\bf set label ``Hallo'' at x,y font
``Helvetica,34''}) and multiple plots on the page.  The proportions of the axes
are not changed.

Syntax:
\begin{verbatim}
        set terminal tgif {<mode>} {<[x,y]>} {<dashed>} \
                          {"<fontname>"} {<fontsize>}
\end{verbatim}

where $<$mode$>$ is {\bf portrait} or {\bf landscape}, $<$[x,y]$>$ specifies the number of
plots in the x and y directions on the page, $<$dashed$>$ is either {\bf solid} or
{\bf dashed}, ''$<$fontname$>$'' is the name of a valid PostScript font, and $<$fontsize$>$
specifies the size of the PostScript font.  Defaults are {\bf portrait}, {\bf [1,1]},
{\bf dashed}, {\bf ``Helvetica''}, and {\bf 18}.

The {\bf solid} option is usually prefered if lines are colored, as they often
are in the editor.  Hardcopy will be black-and-white, so {\bf dashed} should be
chosen for that.

Multiplot is implemented in two different manners.

The first multiplot implementation is the standard gnuplot multiplot feature:

\begin{verbatim}
  set term tgif
  set output "file.obj"
  set multiplot
  set origin x01,y01
  set size  xs,ys
  plot ...
       ...
  set origin x02,y02
  plot ...
  set nomultiplot
\end{verbatim}

See {\bf set multiplot} for further information.

The second version is the [x,y] option for the driver itself.  The advantage
of this implementation is that everything is scaled and placed automatically
without the need for setting origins and sizes; the plots keep their natural
x/y proportions of 3/2 (or whatever is fixed by {\bf set size}).

If both multiplot methods are selected, the standard method is chosen and a
warning message appears.

Examples of single plots (or standard multiplot):
\begin{verbatim}
        set term tgif                  # -> portrait
        set term tgif "Times-Roman" 24 # -> Times-Roman font of size 24
        set term tgif landscape        # -> landscape
        set term tgif landscape solid  # -> landscape and solid lines
\end{verbatim}

Examples using the built-in multiplot mechanism:
\begin{verbatim}
        set term tgif portrait [2,4]   # -> 2 plots in x and 4 in y-direction
        set term tgif [1,2]            # -> 1 plot  in x and 2 in y-direction
        set term tgif landscape [3,3]  # -> landscape, with 3 plots in both
                                       #    x- and  y-directions
\end{verbatim}
\subsubsection{Uniplex}
The uniplex driver is able to combine several plots in one image.  The option
portrait causes the image to be drawn in a window where the width is about
2/3 of the height (default is landscape---the image height is about 2/3 of
the width).  The fontsize may also be specified (sizes 1--8).  Only one image
is allowed per file.  If an 'X' is included in the {\bf set output} filename, the
'X' is replaced by a sequential plot number.

Options are:
\begin{verbatim}
      portrait
      landscape        (default)
      [ x , y ]        (where x and y are the number of plots in the x and y
                        directions of the image)
      n                (where n is fontsize (1--8))
\end{verbatim}

To plot 6 plots in one image in two columns in portrait orientation:
\begin{verbatim}
      set term uniplex po [2,3]
\end{verbatim}
\subsubsection{Windows}
Three options may be set in the windows driver.

Syntax:
\begin{verbatim}
        set terminal windows {<color>} {"<fontname>"} {<fontsize>}
\end{verbatim}

{\bf $<$color$>$} is either {\bf color} or {\bf monochrome}, {\bf ''$<$fontname$>$''} is the name of a
valid Windows font, and {\bf $<$fontsize$>$} is the size of the font in points.
\paragraph{Graph-menu}
The {\bf gnuplot graph} window has the following options on a pop-up menu
accessed by pressing the right mouse button or selecting {\bf Options} from the
system menu:

{\bf Bring to Top} when checked brings the graph window to the top after every
plot.

{\bf Color} when checked enables color linestyles.  When unchecked it forces
monochrome linestyles.

{\bf Copy to Clipboard} copies a bitmap and a Metafile picture.

{\bf Background...} sets the window background color.

{\bf Choose Font...} selects the font used in the graphics window.

{\bf Line Styles...} allows customization of the line colors and styles.

{\bf Print...} prints the graphics windows using a Windows printer driver and
allows selection of the printer and scaling of the output.  The output
produced by {\bf Print} is not as good as that from {\bf gnuplot}'s own printer
drivers.

{\bf Update wgnuplot.ini} saves the current window locations, window sizes, text
window font, text window font size, graph window font, graph window font
size, background color and linestyles to the initialization file
{\bf WGNUPLOT.INI}.
\paragraph{Printing}
In order of preference, graphs may be be printed in the following ways.

{\bf 1.} Use the {\bf gnuplot} command {\bf set terminal} to select a printer and {\bf set
output} to redirect output to a file.

{\bf 2.} Select the {\bf Print...} command from the {\bf gnuplot graph} window.  An extra
command {\bf screendump} does this from the text window.

{\bf 3.} If {\bf set output ``PRN''} is used, output will go to a temporary file.  When
you exit from {\bf gnuplot} or when you change the output with another {\bf set
output} command, a dialog box will appear for you to select a printer port.
If you choose OK, the output will be printed on the selected port, passing
unmodified through the print manager.  It is possible to accidentally (or
deliberately) send printer output meant for one printer to an incompatible
printer.
\paragraph{Text-menu}
The {\bf gnuplot text} window has the following options on a pop-up menu accessed
by pressing the right mouse button or selecting {\bf Options} from the system
menu:

{\bf Copy to Clipboard} copies marked text to the clipboard.

{\bf Paste} copies text from the clipboard as if typed by the user.

{\bf Choose Font...} selects the font used in the text window.

{\bf System Colors} when selected makes the text window honor the System Colors
set using the Control Panel.  When unselected, text is black or blue on a
white background.

{\bf Update wgnuplot.ini} saves the current text window location, text window
size, text window font and text window font size to the initialisation file
{\bf WGNUPLOT.INI}.

{\bf MENU BAR}

If the menu file {\bf WGNUPLOT.MNU} is found in the same directory as
WGNUPLOT.EXE, then the menu specified in {\bf WGNUPLOT.MNU} will be loaded.

Menu commands are:
\begin{verbatim}
  [Menu]       Start a new menu with the name on the following line
  [EndMenu]    End current menu.
  --           Insert a horizontal menu separator
  |            Insert a vertical menu separator
  [Button]     Put next macro on a push button instead of a menu.
\end{verbatim}

Macros take two lines with the macro name (menu entry) on the first line and
the macro on the second line.  Leading spaces are ignored.

Macros commands are:
\begin{verbatim}
  [INPUT]      Input string with prompt terminated by [EOS] or {ENTER}
  [EOS]        End Of String terminator.  Generates no output.
  [OPEN]       Get name of file to open from list box, with title of list box
               terminated by [EOS], followed by default filename terminated
               by [EOS] or {ENTER}.  This uses COMMDLG.DLL from Windows 3.1.
  [SAVE]       Get name of file to save.  Similar to [OPEN]
\end{verbatim}

Macros character substitutions are:
\begin{verbatim}
  {ENTER}      Carriage Return '\r'
  {TAB}        Tab     '\011'
  {ESC}        Escape  '\033'
  {^A}         '\001'
  ...
  {^_}         '\031'
\end{verbatim}

Macros are limited to 256 characters after expansion.
\paragraph{Wgnuplot.ini}
Windows {\bf gnuplot} will read some of its options from the {\bf [WGNUPLOT]} section
of {\bf WGNUPLOT.INI} in the Windows directory.  An example {\bf WGNUPLOT.INI} file
is shown below.

\begin{verbatim}
 [WGNUPLOT]
 TextOrigin=0 0
 TextSize=640 150
 TextFont=Terminal,9
 GraphOrigin=0 150
 GraphSize=640 330
 GraphFont=Arial,10
 GraphColor=1
 GraphToTop=1
 GraphBackground=255 255 255
 Border=0 0 0 0 0
 Axis=192 192 192 2 2
 Line1=0 0 255 0 0
 Line2=0 255 0 0 1
 Line3=255 0 0 0 2
 Line4=255 0 255 0 3
 Line5=0 0 128 0 4
\end{verbatim}

The {\bf GraphFont} entry specifies the font name and size in points.  The five
numbers given in the {\bf Border}, {\bf Axis} and {\bf Line} entries are the {\bf Red}
intensity (0--255), {\bf Green} intensity, {\bf Blue} intensity, {\bf Color Linestyle}
and {\bf Mono Linestyle}.  {\bf Linestyles} are 0=SOLID, 1=DASH, 2=DOT, 3=DASHDOT,
4=DASHDOTDOT.  In the example {\bf WGNUPLOT.INI} file above, Line 2 is a green
solid line in color mode, or a dashed line in monochrome mode.  The default
line width is 1 pixel.  If {\bf Linestyle} is negative, it specifies the width of
a SOLID line in pixels.  Line1 and any linestyle used with the {\bf points} style
must be SOLID with unit width.
\paragraph{Windows3.0}
Windows 3.1 is preferred, but WGNUPLOT will run under Windows 3.0 with the
following restrictions:

{\bf 1.} COMMDLG.DLL and SHELL.DLL (available with Windows 3.1 or Borland C++
3.1) must be in the windows directory.

{\bf 2.} WGNUPLOT.HLP produced by Borland C++ 3.1 is in Windows 3.1 format.
You need to use the WINHELP.EXE supplied with Borland C++ 3.1.

{\bf 3.} It won't run in real mode due to lack of memory.

{\bf 4.} TrueType fonts are not available in the graph window.

{\bf 5.} Drag-drop does not work.
\subsection{Tics}
The {\bf set tics} command can be used to change the tics to be drawn outwards.

Syntax:
\begin{verbatim}
        set tics {<direction>}
        show tics
\end{verbatim}

where $<$direction$>$ may be {\bf in} or {\bf out}.  {\bf set tics} defaults to {\bf in}.  {\bf show
tics} displays a lot of information about the tics.

It is now necessary to do
\begin{verbatim}
  set xtics nomirror ; set ytics nomirror
\end{verbatim}
in order to switch off the duplicate tics on top and right borders.  This is
useful when doing impulse plots.

See also the {\bf set xtics}, {\bf set ytics}, and {\bf set ztics} commands for more
control of tic marks and {\bf set mxtics}, {\bf set mytics}, and {\bf set mztics} for
minor tic marks.
\subsection{Ticslevel}
Using {\bf splot}, one can adjust the relative height of the vertical (Z) axis
using {\bf set ticslevel}.  The numeric argument provided specifies the location
of the bottom of the scale.  A zero will put it on the bottom grid and any
positive number somewhere along the z axis.

Syntax:
\begin{verbatim}
        set ticslevel {<level>}
        show tics
\end{verbatim}

where $<$level$>$ is a non-negative numeric argument.  For example,

\begin{verbatim}
        set ticslevel 0.5
\end{verbatim}

sets the tics level to the default value.

See also {\bf set view}.
\subsection{Ticscale}
The size of the tic marks can be adjusted with {\bf set ticscale}.

Syntax:
\begin{verbatim}
        set ticscale {<major> {<minor>}}
        show tics
\end{verbatim}

If $<$minor$>$ is not specified, it is 0.5*$<$major$>$.  The default size is 1.0 for
major tics and 0.5 for minor tics.  Note that it is possible to have the tic
marks pointing outward by specifying a negative size.
\subsection{Time}
The optional {\bf set time} places the time and date of the plot either at the
top or bottom of the left margin.  The exact location is device dependent.

Syntax:
\begin{verbatim}
        set time {<xoff>}{,<yoff>}
        set notime
        show time
\end{verbatim}

Specifying constants $<$xoff$>$ or $<$yoff$>$ as optional offsets for the time will
move the time $<$xoff$>$ or $<$yoff$>$ character-screen co-ordinates.  For example,

\begin{verbatim}
        set time ,-3
\end{verbatim}

will change only the y offset of the time, moving the title down by roughly
the height of three characters.
\subsection{Timefmt}
This command applies to timeseries where data are composed of dates/times.
It has no meaning unless the command {\bf set \{x,y,z\}data time} is given also.
The string argument tells {\bf gnuplot} how to read timedata from the datafile.
Valid conversion codes are: \%d (day of month,1--31), \%m (month,1--12), \%y
(year,0--99), \%Y (year, 4 digits), \%j (day of year,1--365), \%H (hour,0--24),
\%M (minute,0--60), \%S (second,0--60).  Any character is allowed in the string
(including space), but must match exactly.  Backslash-octals ($\backslash$nnn) are
converted to char; $\backslash$t (tab) is understood.  If there is no separating
character between the date/time elements, then \%d, \%m, \%y, \%H, \%M and \%S read
two digits each, \%Y reads four digits and \%j reads three digits.  Each column
in the timedata counts as one column in the {\bf using n:n} specification.

Syntax:
\begin{verbatim}
        set timefmt "<format string>"
        show timefmt
\end{verbatim}

See also {\bf set \{x,y,z\}data}.

Example:
\begin{verbatim}
        set timefmt "%d/%m/%Y\t%H:%M"
\end{verbatim}
tells {\bf gnuplot} to read date and time separated by tab.
\subsection{Title}
The {\bf set title} command produces a plot title that is centered at the top of
the plot.  {\bf set title} is a special case of {\bf set label}.

Syntax:
\begin{verbatim}
         set title {"<title-text>"} {<xoff>}{,<yoff>}
         show title
\end{verbatim}

Specifying constants $<$xoff$>$ or $<$yoff$>$ as optional offsets for the title will
move the title $<$xoff$>$ or $<$yoff$>$ character screen co-ordinates (not plot
co-ordinates).  For example,

\begin{verbatim}
         set title ,-1
\end{verbatim}

will change only the y offset of the title, moving the title down by
roughly the height of one character.

{\bf set title} with no parameters clears the title.

See {\bf set syntax} for details about the processing of backslash sequences and
the distinction between single- and double-quotes.
\subsection{Tmargin}
The command {\bf set tmargin} sets the size of the top margin.  Please see
{\bf set margins} for details.
\subsection{Trange}
The {\bf set trange} command sets the parametric range used to compute x and y
values when in parametric or polar modes.  Please see {\bf set range} for
details.
\subsection{Urange}
The {\bf set urange} and {\bf set vrange} commands set the parametric ranges used
to compute x, y, and z values when in {\bf splot} parametric mode.  Please see
{\bf set range} for details.
\subsection{Variables}
The {\bf show variables} command lists all user-defined variables and their
values.

Syntax:
\begin{verbatim}
        show variables
\end{verbatim}
\subsection{View}
The {\bf set view} command sets the viewing angle for {\bf splot}s.  It controls how
the 3-d co-ordinates of the plot are mapped into the 2-d screen space.  It
provides controls for both rotation and scaling of the plotted data, but
supports orthographic projections only.

Syntax:
\begin{verbatim}
        set view <rot_x> {,{<rot_z>}{,{<scale>}{,<scale_z>}}}
        show view
\end{verbatim}

where $<$rot\_x$>$ and $<$rot\_z$>$ control the rotation angles (in degrees) along a
virtual 3-d co-ordinate system aligned with the screen such that the screen
horizontal axis is x, screen vertical axis is y, and the axis perpendicular
to the screen is z.  $<$rot\_x$>$ is bounded to the [0:180] range with a default
of 60 degrees, while $<$rot\_z$>$ is bounded to the [0:360] range with a default
of 30 degrees.  $<$scale$>$ controls the scaling of the entire {\bf splot}, while
$<$scale\_z$>$ scales the z axis only.  Both scales default to 1.0.

Examples:
\begin{verbatim}
        set view 60, 30, 1, 1
        set view ,,0.5
\end{verbatim}

The first sets all the four default values.  The second changes only scale,
to 0.5.

See also {\bf set ticslevel}.
\subsection{Vrange}
The {\bf set urange} and {\bf set vrange} commands set the parametric ranges used
to compute x, y, and z values when in {\bf splot} parametric mode.  Please see
{\bf set range} for details.
\subsection{X2data}
Sets x2-axis data to timeseries (dates/times).  Please see {\bf set xdata}.
\subsection{X2dtics}
The {\bf set x2dtics} command changes tics on the x2 axis to days of the week.
Please see {\bf set xmtics} for details.
\subsection{X2label}
This command sets the label for the x2 axis.  Please see {\bf set xlabel}.
\subsection{X2mtics}
The {\bf set x2mtics} command changes tics on the x2 axis to months of the year.
Please see {\bf set xmtics} for details.
\subsection{X2range}
The {\bf set x2range} command sets the horizontal range that will be displayed
on the x2 (top) axis.  Please see {\bf set range} for details.
\subsection{X2tics}
The {\bf set x2tics} command controls major (labelled) tics on the x2 axis.
Please see {\bf set xtics} for details.
\subsection{X2zeroaxis}
The {\bf set x2zeroaxis} command draws a line at x2 = 0.  For details, please see
{\bf set zeroaxis}.
\subsection{Xdata}
This command sets the datatype on the x axis to date/time.  A similar command
does the same thing for each of the other axes.

Syntax:
\begin{verbatim}
        set xdata time
        set ydata time
        set zdata time
        set x2data time
        set y2data time
\end{verbatim}

To turn the x axis data back to the default:
\begin{verbatim}
        set xdata
\end{verbatim}

See {\bf set timefmt} to tell {\bf gnuplot} how to read date or time data.  The
date/time is converted to seconds from start of the century.  There is
currently only one timefmt, which implies that all the date/time columns must
confirm to this format.  Specification of ranges should be supplied as quoted
strings according to this format to avoid interpretation of the date/time as
an expression.

The function ``strftime'' (type ``man strftime'' on unix to look it up) is used
to print ticmark labels.  {\bf gnuplot} tries to figure out a reasonable format
for this  unless the {\bf set format x ``string''} has supplied something that does
not look like a decimal format (more than one '\%' or neither \%f nor \%g).
\subsection{Xdtics}
The {\bf set xdtics} commands converts the x-axis tic marks to days of the week
where 0=Sun and 6=Sat.  Overflows are converted modulo 7 to dates.  {\bf set
noxdtics} returns the labels to their default values.  Similar commands do
the same things for the other axes.

Syntax:
\begin{verbatim}
       set xdtics
       set ydtics
       set zdtics
       set x2dtics
       set y2dtics
       set noxdtics
       etc.
       show xdtics
       etc.
\end{verbatim}

See also the {\bf set format} command.
\subsection{Xlabel}
The {\bf set xlabel} command sets the x axis label.  Similar commands set labels
on the other axes.  There is no explicit {\bf set x2label} command---use {\bf set
title} (see below).

Syntax:
\begin{verbatim}
         set xlabel {"<label>"} {<xoff>}{,<yoff>}
         set ylabel {"<label>"} {<xoff>}{,<yoff>}
         set zlabel {"<label>"} {<xoff>}{,<yoff>}
         set y2label {"<label>"} {<xoff>}{,<yoff>}
         show xlabel
         etc.
\end{verbatim}

Specifying the constants $<$xoff$>$ or $<$yoff$>$ as optional offsets for a label
will move it $<$xoff$>$ or $<$yoff$>$ character screen co-ordinates.  For example,

\begin{verbatim}
         set xlabel -1
\end{verbatim}

will change only the x offset of the xlabel, moving the label roughly one
character width to the left.

To clear the label, put no options on the command line.  For example,

\begin{verbatim}
         set y2label
\end{verbatim}

The default positions of the axis labels are as follows:

xlabel:  The x-axis label is centered below the bottom axis.

ylabel:  The position of the y-axis label depends on the terminal, and can be
one of the following three positions:

1. Horizontal text flushed left at the top left of the plot.  Terminals that
cannot rotate text will probably use this method.

2. Vertical text centered vertically at the left of the plot.  Terminals that
can rotate text will probably use this method.

3. Horizontal text centered vertically at the left of the plot.  The EEPIC,
LaTeX and TPIC drivers use this method.  The user must insert line breaks
using $\backslash$$\backslash$ to prevent the ylabel from overwriting the plot.  To produce a
vertical row of characters, add $\backslash$$\backslash$ between every printing character (but this
is ugly).

zlabel: The z-axis label is centered along the z axis and placed in the space
above the grid level.

y2label: The y2-axis label is placed to the right of the y2 axis.  The
position is terminal-dependent in the same manner as is the y-axis label.

x2label: There is no {\bf set x2label} command.  If you want to put a label on
the x2 axis, use the 'set title' command with new-line characters ''$\backslash$n'', i.e.,

\begin{verbatim}
         set title "This is the title\n\nThis is the x2label"
\end{verbatim}

Note that double quotes must be used.

Please see {\bf set syntax} for further information about backslash processing
and the difference between single- and double-quoted strings.
\subsection{Xmtics}
The {\bf set xmtics} commands converts the x-axis tic marks to months of the
year where 1=Jan and 12=Dec.  Overflows are converted modulo 12 to months.
The tics are returned to their default labels by {\bf set noxmtics}.  Similar
commands perform the same duties for the other axes.

Examples:
\begin{verbatim}
       set xmtics
       set ymtics
       set zmtics
       set x2mtics
       set y2mtics
       set noxmtics
       etc.
       show xmtics
       etc.
\end{verbatim}

See also the {\bf set format} command.
\subsection{Xrange}
The {\bf set xrange} command sets the horizontal range that will be displayed
on the x axis.  Please see {\bf set range} for details.
\subsection{Xtics}
Fine control of the major (labelled) tics on the x axis is possible with the
{\bf set xtics} command.  The tics may be turned off with the {\bf set noxtics}
command, and may be turned on (the default state) with {\bf set xtics}.  Similar
commands control the major tics on the other axes.

Syntax:
\begin{verbatim}
         set xtics {axis | border} {{no}mirror} \
                     { {<start>, <incr>{, <end>}} |
                     {({"<label>"} <pos> {, {"<label>"} <pos>}...)} }
         set ytics (same options)
         set ztics (same options)
         set x2tics (same options)
         set y2tics (same options)
         set noxtics
         etc.
         show xtics
         etc.
\end{verbatim}

{\bf axis} or {\bf border} tells {\bf gnuplot} to put the tics (both the tics themselves
and the accompanying labels) along the axis or the border, respectively.
{\bf mirror} tells it to put unlabelled tics at the same positions on the
opposite border.  {\bf nomirror} does what you think it does.  The defaults are
{\bf border mirror} for tics on the x, y, x2, and y2 axes.  For the z axis, the
the {\bf \{axis$|$border\}} option is not available and the default is {\bf nomirror}.
If you do want to mirror the z-axis tics, you might want to create a bit more
room for them with {\bf set border}.

The positions of the tics may be specified in either of two forms:

The $<$start$>$, $<$incr$>$, $<$end$>$ form specifies that a series of tics will be
plotted on the axis between the values $<$start$>$ and $<$end$>$ with an increment of
$<$incr$>$.  If $<$end$>$ is not given, it is assumed to be infinity.  The increment
may be negative.

Example:
\begin{verbatim}
          set xtics 0,.5,10
\end{verbatim}
makes tics at 0, 0.5, 1, 1.5, ..., 9.5, 10.

The (''$<$label$>$'' $<$pos$>$, ...) form allows arbitrary tic positions or non-numeric
tic labels.  A set of tics is a set of positions, each with its own optional
label.  Note that the label is a string enclosed by quotes, and may be a
constant string, such as ``hello'', or contain formatting information for the
tic number (which is the same as the position), such as ''\%3f clients''.  See
{\bf set format} for more information about this case.  The label may be made
empty by specifying it as an empty string.  If no string is given, the
default label (numerical) is used.  In this form, the tics do not need to be
listed in numerical order.

Examples:
\begin{verbatim}
         set xtics ("low" 0, "medium" 50, "high" 100)
         set xtics (1,2,4,8,16,32,64,128,256,512,1024)
         set ytics ("bottom" 0, "" 10, "top" 20)
\end{verbatim}

In the second example, all tics are labelled.  In the third, only the end
tics are labelled.

Tics will only be plotted when in range.

Minor (unlabelled) tics can be added by the {\bf set mxtics} command.

In case of timeseries data, position values must be given as quoted dates
or times according to the format {\bf timefmt}.
\subsection{Xzeroaxis}
The {\bf set xzeroaxis} command draws a line at x = 0.  For details, please see
{\bf set zeroaxis}.
\subsection{Y2data}
Sets y2-axis data to timeseries (dates/times).  Please see {\bf set xdata}.
\subsection{Y2dtics}
The {\bf set y2dtics} command changes tics on the y2 axis to days of the week.
Please see {\bf set xmtics} for details.
\subsection{Y2label}
This command sets the label for the y2 axis.  Please see {\bf set xlabel}.
\subsection{Y2mtics}
The {\bf set y2mtics} command changes tics on the y2 axis to months of the year.
Please see {\bf set xmtics} for details.
\subsection{Y2range}
The {\bf set y2range} command sets the vertical range that will be displayed on
the y2 axis.  Please see {\bf set range} for details.
\subsection{Y2tics}
The {\bf set y2tics} command controls major (labelled) tics on the y2 axis.
Please see {\bf set xtics} for details.
\subsection{Y2zeroaxis}
The {\bf set y2zeroaxis} command draws a line at y2 = 0.  For details, please see
{\bf set zeroaxis}.
\subsection{Ydata}
Sets y-axis data to timeseries (dates/times).  Please see {\bf set xdata}.
\subsection{Ydtics}
The {\bf set ydtics} command changes tics on the y axis to days of the week.
Please see {\bf set xmtics} for details.
\subsection{Ylabel}
This command sets the label for the y axis.  Please see {\bf set xlabel}.
\subsection{Ymtics}
The {\bf set ymtics} command changes tics on the y axis to months of the year.
Please see {\bf set xmtics} for details.
\subsection{Yrange}
The {\bf set yrange} command sets the vertical range that will be displayed on
the y axis.  Please see {\bf set range} for details.
\subsection{Ytics}
The {\bf set ytics} command controls major (labelled) tics on the y axis.
Please see {\bf set xtics} for details.
\subsection{Yzeroaxis}
The {\bf set yzeroaxis} command draws a line at y = 0.  For details, please see
{\bf set zeroaxis}.
\subsection{Zdata}
Set zaxis date to timeseries (dates/times).  Please see {\bf set xdata}.
\subsection{Zdtics}
The {\bf set zdtics} command changes tics on the z axis to days of the week.
Please see {\bf set xmtics} for details.
\subsection{Zero}
The {\bf zero} value is the default threshold for values approaching 0.0.

Syntax:
\begin{verbatim}
        set zero <expression>
        show zero
\end{verbatim}

{\bf gnuplot} will not plot a point if its imaginary part is greater in magnitude
than the {\bf zero} threshold.  Axis ranges cannot be less than {\bf zero}.  The
default {\bf zero} value is 1e-8.
\subsection{Zeroaxis}
The command {\bf set zeroaxis} draws the x axis and y axis.  It may be removed by
{\bf set nozeroaxis}.  The x axis alone may be drawn by {\bf set xzeroaxis} and
removed by {\bf set noxzeroaxis}.  Similar commands behave similarly for the y,
x2, and y2 axes.

Syntax:
\begin{verbatim}
        set zeroaxis {<linestyle>}
        set xzeroaxis {<linestyle>}
        set yzeroaxis {<linestyle>}
        set x2zeroaxis {<linestyle>}
        set y2zeroaxis {<linestyle>}
        set nozeroaxis
        set noxzeroaxis
        etc.
        show zeroaxis
        show xzeroaxis
        etc.
\end{verbatim}

By default, these options are off.  If $<$linestyle$>$ is not specified, any
zero axes selected will be drawn using the axis linetype.

{\bf set zeroaxis l} is equivalent to {\bf set xzeroaxis l; set yzeroaxis l}.
{\bf set nozeroaxis} is equivalent to {\bf set noxzeroaxis; set noyzeroaxis}.
\subsection{Zlabel}
This command sets the label for the z axis.  Please see {\bf set xlabel}.
\subsection{Zmtics}
The {\bf set zmtics} command changes tics on the z axis to months of the year.
Please see {\bf set xmtics} for details.
\subsection{Zrange}
The {\bf set zrange} command sets the range that will be displayed on the z axis.
The zrange is used only by {\bf splot} and is ignored by {\bf plot}.  Please see {\bf set
range} for details.
\subsection{Ztics}
The {\bf set ztics} command controls major (labelled) tics on the z axis.
Please see {\bf set xtics} for details.
\section{Shell}
The {\bf shell} command spawns an interactive shell.  To return to {\bf gnuplot},
type {\bf logout} if using VMS, {\bf exit} or the END-OF-FILE character if using
Unix, {\bf endcli} if using AmigaDOS, or {\bf exit} if using MS-DOS or OS/2.

A single shell command may be spawned by preceding it with the ! character
(\$ if using VMS) at the beginning of a command line.  Control will return
immediately to {\bf gnuplot} after this command is executed.  For example, in
Unix, AmigaDOS, MS-DOS or OS/2,

\begin{verbatim}
     ! dir
\end{verbatim}

prints a directory listing and then returns to {\bf gnuplot}.

On an Atari, the {\bf !} command first checks whether a shell is already loaded
and uses it, if available.  This is practical if {\bf gnuplot} is run from
{\bf gulam}, for example.
\section{Splot}
Three-dimensional surface and contour plotting is available in {\bf gnuplot} with
the {\bf splot} command.  See the {\bf plot} command for features common to the
{\bf plot} command.

See also {\bf set contour}, {\bf set cntrparam}, and {\bf set surface}.
\section{Start-up}
When {\bf gnuplot} is run, it looks for an initialization file to load.  This
file is called {\bf .gnuplot} on Unix and AmigaDOS systems, and {\bf GNUPLOT.INI}
on other systems.  If this file is not found in the current directory, the
program will look for it in the home directory (under AmigaDOS,
Atari(single)TOS, MS-DOS and OS/2, the environment variable {\bf gnuplot} should
contain the name of this directory).  Note: if NOCWDRC is defined during the
installation, {\bf gnuplot} will not read from the current directory.

If this file is found, {\bf gnuplot} executes the commands in this file.  This
is most useful for setting the terminal type and defining any functions or
variables that are used often.
\section{Substitution}
Command-line substitution is specified by a system command enclosed in
backquotes.  This command is spawned and the output it produces replaces
the name of the command (and backquotes) on the command line.

Newlines in the output produced by the spawned command are replaced with
blanks.

Command-line substitution can be used anywhere on the {\bf gnuplot} command
line.

Example:

This will run the program {\bf leastsq} and replace {\bf leastsq} (including
backquotes) on the command line with its output:

\begin{verbatim}
         f(x) = `leastsq`
\end{verbatim}

or, in VMS

\begin{verbatim}
         f(x) = `run leastsq`
\end{verbatim}
\section{Syntax}
The general rules of syntax and punctuation in {\bf gnuplot} are that keywords
and options are order-dependent.  Options and any accompanying parameters are
separated by spaces whereas lists and co-ordinates are separated by commas.
Ranges are separated by colons and enclosed in braces [], text and file names
are enclosed in quotes, and a few miscellaneous things are enclosed in
parentheses.  Brackets \{\} are used for a few special purposes.

Commas are used to separate co-ordinates (see {\bf set co-ordinates}); the list
of variables being fitted (the list after the {\bf via} keyword on the {\bf fit}
command); lists of discrete contours or the loop parameters which specify
them (see {\bf set cntrparam}); the arguments of the {\bf set} commands {\bf dgrid3d},
{\bf dummy}, {\bf isosamples}, {\bf offsets}, {\bf origin}, {\bf samples}, {\bf size}, {\bf time}, and
{\bf view}; lists of tics or the loop parameters which specify them; the offsets
for titles and axis labels; parametric functions to be used to calculate the
x, y, and z co-ordinates on the {\bf s/plot} commands; and the complete sets of
keywords specifying individual data sets or functions on {\bf s/plot} commands.

Parentheses are used to delimit sets of explicit tics (as opposed to loop
parameters) and to indicate computations in the {\bf using} filter of the {\bf fit}
and {\bf s/plot} commands.

(Parentheses and commas are also used as usual in function notation.)

Braces are used to delimit ranges, whether they are given in {\bf set} commands
or on {\bf s/plot} commands.

Colons are used to separate extrema in {\bf range} specifications and to
separate columns in the {\bf using} filter of the {\bf s/plot} and {\bf fit} commands.

Semicolons are used to separate commands given on a single line.

Brackets are used in text to be specially processed by some terminals, like
{\bf enhpost}.  They are also used to denote complex numbers: \{3,2\} = 3 + 2i.

Text may be enclosed in single- or double-quotes.  Backslash processing of
sequences like $\backslash$n (newline) is performed for double-quoted strings, but not
for single-quoted strings.  The justification is the same for each line of a
multi-line string.  Thus the center-justified string

\begin{verbatim}
       "This is the first line of text.\nThis is the second line."
\end{verbatim}

will produce

\begin{verbatim}
        This is the first line of text.
           This is the second line.
\end{verbatim}

but

\begin{verbatim}
       'This is the first line of text.\nThis is the second line.'
\end{verbatim}

will produce

\begin{verbatim}
        This is the first line of text.\nThis is the second line.
\end{verbatim}

Both single- and double-quoted strings process $\backslash$nnn correctly.

The EEPIC, Imagen, Uniplex, LaTeX, and TPIC drivers allow $\backslash$$\backslash$ in a string to
specify a newline.
\section{Test}
{\bf test} creates a display of line and point styles and other useful things
appropriate for the terminal you are using.

Syntax: test
\section{Update}
This command updates the start parameter assignments in a start parameter
file as specified in the {\bf fit} section.  Each parameter will be replaced
by its actual value.  This is useful for restarting a converged or stopped
fit again.

Syntax:
\begin{verbatim}
        update <filename>
\end{verbatim}

See {\bf fit}
\section{User-defined}
New user-defined variables and functions of one through five variables may
be declared and used anywhere.

User-defined function syntax:
\begin{verbatim}
        <function-name> ( <dummy1> {,<dummy2> {, ...} } ) = <expression>
\end{verbatim}

where $<$expression$>$ is defined in terms of $<$dummy1$>$ through $<$dummy5$>$.

User-defined variable syntax:
\begin{verbatim}
        <variable-name> = <constant-expression>
\end{verbatim}

Examples:
\begin{verbatim}
        w = 2
        q = floor(tan(pi/2 - 0.1))
        f(x) = sin(w*x)
        sinc(x) = sin(pi*x)/(pi*x)
        delta(t) = (t == 0)
        ramp(t) = (t > 0) ? t : 0
        min(a,b) = (a < b) ? a : b
        comb(n,k) = n!/(k!*(n-k)!)
        len3d(x,y,z) = sqrt(x*x+y*y+z*z)
\end{verbatim}

Note that the variable {\bf pi} is already defined.

See {\bf show functions} and {\bf show variables}.
\section{Bugs}
The bessel functions do not work for complex arguments.

The gamma function does not work for complex arguments.

There is a bug in the stdio library for old Sun operating systems (SunOS
Sys4-3.2).  The ''\%g'' format for 'printf' sometimes incorrectly prints numbers
(e.g., 200000.0 as ``2'').  Thus, tic mark labels may be incorrect on a Sun4
version of {\bf gnuplot}.  A work-around is to rescale the data or use the {\bf set
format} command to change the tic mark format to ''\%7.0f'' or some other
appropriate format.  This appears to have been fixed in SunOS 4.0.

Another bug: On a Sun3 under SunOS 4.0, and on Sun4's under Sys4-3.2 and
SunOS 4.0, the 'sscanf' routine incorrectly parses ``00 12'' with the format
''\%f \%f'' and reads 0 and 0 instead of 0 and 12.  This affects data input.  If
the data file contains x co-ordinates that are zero but are specified like
'00', '000', etc, then you will read the wrong y values.  Check any data
files or upgrade the SunOS.  It appears to have been fixed in SunOS 4.1.1.

Suns appear to overflow when calculating exp(-x) for large x, so {\bf gnuplot}
gets an undefined result.  One work-around is to make a user-defined function
like e(x) = x$<$-500 ? 0 : exp(x).  This affects plots of Gaussians (exp(-x*x))
in particular, since x*x grows quite rapidly.

Microsoft C 5.1 has a nasty bug associated with the \%g format for printf.
When any of the formats ''\%.2g'', ''\%.1g'', ''\%.0g'', ''\%.g'' are used, printf will
incorrectly print numbers in the range 1e-4 to 1e-1.  Numbers that should be
printed in the \%e format are incorrectly printed in the \%f format, with the
wrong number of zeros after the decimal point.  To work around this problem,
use the \%e or \%f formats explicitly.

{\bf gnuplot}, when compiled with Microsoft C, did not work correctly on two VGA
displays that were tested.  The CGA, EGA and VGA drivers should probably be
rewritten to use the Microsoft C graphics library.  {\bf gnuplot} compiled with
Borland C++ uses the Turbo C graphics drivers and does work correctly with
VGA displays.

VAX/VMS 4.7 C compiler release 2.4 also has a poorly implemented \%g format
for printf.  The numbers are printed numerically correct, but may not be in
the requested format.  The K\&R second edition says that for the \%g format, \%e
is used if the exponent is less than -4 or greater than or equal to the
precision.  The VAX uses \%e format if the exponent is less than -1.  The VAX
appears to take no notice of the precision when deciding whether to use \%e or
\%f for numbers less than 1.  To work around this problem, use the \%e or \%f
formats explicitly.  From the VAX C 2.4 release notes: e,E,f,F,g,G  Result
will always contain a decimal  point.  For g and G, trailing zeros will not
be removed from the result.

VAX/VMS 5.2 C compiler release 3.0 has a slightly better implemented \%g
format than release 2.4, but not much.  Trailing decimal points are now
removed, but trailing zeros are still not removed from \%g numbers in
exponential format.

ULTRIX X11R3 has a bug that causes the X11 driver to display ``every other''
plot.  The bug seems to be fixed in DEC's release of X11R4 so newer releases
of ULTRIX don't seem to have the problem.  Solutions for older sites include
upgrading the X11 libraries (from DEC or direct from MIT) or defining
ULTRIX\_KLUDGE when compiling the x11.trm file.  Note that the kludge is not
an ideal fix, however.

The constant HUGE was incorrectly defined in the NeXT OS 2.0 operating
system.  HUGE should be set to 1e38 in plot.h. This error has been corrected
in the 2.1 version of NeXT OS.

Some older models of HP plotters do not have a page eject command 'PG'.  The
current HPGL driver uses this command in HPGL\_reset.  This may need to be
removed for these plotters.  The current PCL5 driver uses HPGL/2 for text as
well as graphics.  This should be modified to use scalable PCL fonts.

On the Atari version, it is not possible to send output directly to the
printer (using {\bf /dev/lp} as output file), since CRs are added to LFs in
binary output.  As a work-around, write the output to a file and copy it to
the printer afterwards using a shell command.

There may be an up-to-date list of bugs since the release on the WWW page:
\begin{verbatim}
   http://www.cs.dartmouth.edu/gnuplot
\end{verbatim}

Please report any bugs to bug-gnuplot@dartmouth.edu.
\end{document}
